From 03e598c625edfb06cf450009995dba48c994af84 Mon Sep 17 00:00:00 2001 From: Oleh Kurpiak Date: Wed, 21 Jul 2021 18:03:38 +0300 Subject: [PATCH] [Java][Spring] fix Spring RequestMapping --- .../main/resources/JavaSpring/api.mustache | 3 +- .../main/resources/java-pkmst/api.mustache | 3 +- .../main/resources/kotlin-spring/api.mustache | 3 +- .../kotlin-spring/apiInterface.mustache | 3 +- .../2_0/petstore-with-spring-pageable.yaml | 9 ++++ .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 39 ++++++++++++---- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../kotlin/org/openapitools/api/PetApi.kt | 24 ++++++---- .../kotlin/org/openapitools/api/StoreApi.kt | 12 +++-- .../kotlin/org/openapitools/api/UserApi.kt | 24 ++++++---- .../kotlin/org/openapitools/api/PetApi.kt | 24 ++++++---- .../kotlin/org/openapitools/api/StoreApi.kt | 12 +++-- .../kotlin/org/openapitools/api/UserApi.kt | 24 ++++++---- .../kotlin/org/openapitools/api/PetApi.kt | 24 ++++++---- .../kotlin/org/openapitools/api/StoreApi.kt | 12 +++-- .../kotlin/org/openapitools/api/UserApi.kt | 24 ++++++---- .../org/openapitools/api/TestHeadersApi.java | 3 +- .../openapitools/api/TestQueryParamsApi.java | 3 +- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- .../virtualan/api/AnotherFakeApi.java | 3 +- .../openapitools/virtualan/api/FakeApi.java | 45 ++++++++++++------- .../virtualan/api/FakeClassnameTestApi.java | 3 +- .../openapitools/virtualan/api/PetApi.java | 24 ++++++---- .../openapitools/virtualan/api/StoreApi.java | 12 +++-- .../openapitools/virtualan/api/UserApi.java | 24 ++++++---- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++---- 139 files changed, 1688 insertions(+), 832 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index 770bfd301831..d8b38705778f 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -120,7 +120,8 @@ public interface {{classname}} { {{/headerParams}} }) {{/implicitHeaders}} - @{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Mapping( + @RequestMapping( + method = RequestMethod.{{httpMethod}}, value = "{{{path}}}"{{#singleContentTypes}}{{#hasProduces}}, produces = "{{{vendorExtensions.x-accepts}}}"{{/hasProduces}}{{#hasConsumes}}, consumes = "{{{vendorExtensions.x-contentType}}}"{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}, diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/api.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/api.mustache index 49a986b1c3b7..f2abfbf4119e 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/api.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/api.mustache @@ -55,7 +55,8 @@ public interface {{classname}} { {{#headerParams}}{{>implicitHeader}}{{/headerParams}} }) {{/implicitHeaders}} - @{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Mapping( + @RequestMapping( + method = RequestMethod.{{httpMethod}}, value = "{{{path}}}"{{#singleContentTypes}}, produces = "{{{vendorExtensions.x-accepts}}}", consumes = "{{{vendorExtensions.x-contentType}}}"{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}, diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache index 4faa920013ca..7eceb8f43aa8 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache @@ -63,7 +63,8 @@ class {{classname}}Controller({{#serviceInterface}}@Autowired(required = true) v authorizations = [{{#authMethods}}Authorization(value = "{{name}}"{{#isOAuth}}, scopes = [{{#scopes}}AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}}]{{/isOAuth}}){{^-last}}, {{/-last}}{{/authMethods}}]{{/hasAuthMethods}}) @ApiResponses( value = [{{#responses}}ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{baseType}}}::class{{/baseType}}{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}}]){{/swaggerAnnotations}} - @{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Mapping( + @RequestMapping( + method = [RequestMethod.{{httpMethod}}], value = ["{{#lambda.escapeDoubleQuote}}{{path}}{{/lambda.escapeDoubleQuote}}"]{{#singleContentTypes}}{{#hasProduces}}, produces = "{{{vendorExtensions.x-accepts}}}"{{/hasProduces}}{{#hasConsumes}}, consumes = "{{{vendorExtensions.x-contentType}}}"{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}, diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache index 5e9b3888c8d3..3a2ea440bd1f 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache @@ -71,7 +71,8 @@ interface {{classname}} { authorizations = [{{#authMethods}}Authorization(value = "{{name}}"{{#isOAuth}}, scopes = [{{#scopes}}AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}}]{{/isOAuth}}){{^-last}}, {{/-last}}{{/authMethods}}]{{/hasAuthMethods}}) @ApiResponses( value = [{{#responses}}ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{baseType}}}::class{{/baseType}}{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}}]){{/swaggerAnnotations}} - @{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Mapping( + @RequestMapping( + method = [RequestMethod.{{httpMethod}}], value = ["{{#lambda.escapeDoubleQuote}}{{path}}{{/lambda.escapeDoubleQuote}}"]{{#singleContentTypes}}{{#hasProduces}}, produces = "{{{vendorExtensions.x-accepts}}}"{{/hasProduces}}{{#hasConsumes}}, consumes = "{{{vendorExtensions.x-contentType}}}"{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}, diff --git a/modules/openapi-generator/src/test/resources/2_0/petstore-with-spring-pageable.yaml b/modules/openapi-generator/src/test/resources/2_0/petstore-with-spring-pageable.yaml index 83b998dc15e3..a0cb3d27d2fb 100644 --- a/modules/openapi-generator/src/test/resources/2_0/petstore-with-spring-pageable.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/petstore-with-spring-pageable.yaml @@ -481,6 +481,15 @@ paths: responses: default: description: successful operation + options: + tags: + - user + summary: logoutUserOptions + description: '' + operationId: logoutUserOptions + responses: + default: + description: endpoint configuration response '/user/{username}': get: tags: diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index 6dc5d09f0c8a..6d2acfd913d1 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -41,7 +41,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = "application/json" ) @@ -62,7 +63,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/pet/{petId}" ) CompletableFuture> deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @@ -84,7 +86,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = "application/json" ) @@ -108,7 +111,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = "application/json" ) @@ -132,7 +136,8 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = "application/json" ) @@ -156,7 +161,8 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = "application/json" ) @@ -178,7 +184,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) @@ -200,7 +207,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data" diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index 0c181e59ee37..dfaca74e18b9 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -40,7 +40,8 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) CompletableFuture> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("orderId") String orderId); @@ -58,7 +59,8 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = "application/json" ) @@ -79,7 +81,8 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{orderId}", produces = "application/json" ) @@ -97,7 +100,8 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = "application/json" ) diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index f62f460d1213..534f8bd1d990 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -38,7 +38,8 @@ public interface UserApi { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) CompletableFuture> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body); @@ -53,7 +54,8 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) CompletableFuture> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -68,7 +70,8 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) CompletableFuture> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -86,7 +89,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) CompletableFuture> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username); @@ -105,7 +109,8 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = "application/json" ) @@ -124,7 +129,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = "application/json" ) @@ -139,7 +145,8 @@ public interface UserApi { @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) CompletableFuture> logoutUser(); @@ -158,7 +165,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/user/{username}" ) CompletableFuture> updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body); diff --git a/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/PetApi.java index f77fdf21de24..abfafd5c46c4 100644 --- a/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -40,7 +40,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = "application/json" ) @@ -61,7 +62,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/pet/{petId}" ) com.netflix.hystrix.HystrixCommand> deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @@ -83,7 +85,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = "application/json" ) @@ -107,7 +110,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = "application/json" ) @@ -131,7 +135,8 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = "application/json" ) @@ -155,7 +160,8 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = "application/json" ) @@ -177,7 +183,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) @@ -199,7 +206,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data" diff --git a/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index 241a82690b1e..b60008cdfdca 100644 --- a/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -39,7 +39,8 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) com.netflix.hystrix.HystrixCommand> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("orderId") String orderId); @@ -57,7 +58,8 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = "application/json" ) @@ -78,7 +80,8 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{orderId}", produces = "application/json" ) @@ -96,7 +99,8 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = "application/json" ) diff --git a/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/UserApi.java index ad21d7b81059..6763671ed536 100644 --- a/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -37,7 +37,8 @@ public interface UserApi { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) com.netflix.hystrix.HystrixCommand> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body); @@ -52,7 +53,8 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) com.netflix.hystrix.HystrixCommand> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -67,7 +69,8 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) com.netflix.hystrix.HystrixCommand> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -85,7 +88,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) com.netflix.hystrix.HystrixCommand> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username); @@ -104,7 +108,8 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = "application/json" ) @@ -123,7 +128,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = "application/json" ) @@ -138,7 +144,8 @@ public interface UserApi { @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) com.netflix.hystrix.HystrixCommand> logoutUser(); @@ -157,7 +164,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/user/{username}" ) com.netflix.hystrix.HystrixCommand> updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body); diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index 8b6ead39e2c7..73444cc99903 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -40,7 +40,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = "application/json" ) @@ -61,7 +62,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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); @@ -83,7 +85,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = "application/json" ) @@ -107,7 +110,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = "application/json" ) @@ -131,7 +135,8 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = "application/json" ) @@ -155,7 +160,8 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = "application/json" ) @@ -177,7 +183,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) @@ -199,7 +206,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data" diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 83d5530deb79..106a5e5dff22 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -39,7 +39,8 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + 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); @@ -57,7 +58,8 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = "application/json" ) @@ -78,7 +80,8 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{orderId}", produces = "application/json" ) @@ -96,7 +99,8 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = "application/json" ) diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 683cff0ce64b..989703bc0dff 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -37,7 +37,8 @@ public interface UserApi { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body); @@ -52,7 +53,8 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -67,7 +69,8 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -85,7 +88,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username); @@ -104,7 +108,8 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = "application/json" ) @@ -123,7 +128,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = "application/json" ) @@ -138,12 +144,28 @@ public interface UserApi { @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) ResponseEntity logoutUser(); + /** + * OPTIONS /user/logout : logoutUserOptions + * + * @return endpoint configuration response (status code 200) + */ + @ApiOperation(value = "logoutUserOptions", nickname = "logoutUserOptions", notes = "", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "endpoint configuration response") }) + @RequestMapping( + method = RequestMethod.OPTIONS, + value = "/user/logout" + ) + ResponseEntity logoutUserOptions(); + + /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -157,7 +179,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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 f77fdf21de24..abfafd5c46c4 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 @@ -40,7 +40,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = "application/json" ) @@ -61,7 +62,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/pet/{petId}" ) com.netflix.hystrix.HystrixCommand> deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @@ -83,7 +85,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = "application/json" ) @@ -107,7 +110,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = "application/json" ) @@ -131,7 +135,8 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = "application/json" ) @@ -155,7 +160,8 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = "application/json" ) @@ -177,7 +183,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) @@ -199,7 +206,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data" 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 241a82690b1e..b60008cdfdca 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 @@ -39,7 +39,8 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) com.netflix.hystrix.HystrixCommand> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("orderId") String orderId); @@ -57,7 +58,8 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = "application/json" ) @@ -78,7 +80,8 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{orderId}", produces = "application/json" ) @@ -96,7 +99,8 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = "application/json" ) 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 ad21d7b81059..6763671ed536 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 @@ -37,7 +37,8 @@ public interface UserApi { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) com.netflix.hystrix.HystrixCommand> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body); @@ -52,7 +53,8 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) com.netflix.hystrix.HystrixCommand> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -67,7 +69,8 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) com.netflix.hystrix.HystrixCommand> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -85,7 +88,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) com.netflix.hystrix.HystrixCommand> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username); @@ -104,7 +108,8 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = "application/json" ) @@ -123,7 +128,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = "application/json" ) @@ -138,7 +144,8 @@ public interface UserApi { @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) com.netflix.hystrix.HystrixCommand> logoutUser(); @@ -157,7 +164,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/user/{username}" ) com.netflix.hystrix.HystrixCommand> updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body); diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index 08660cdaac36..02f742561a88 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -44,7 +44,8 @@ default Optional getRequest() { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = "application/json" ) @@ -68,7 +69,8 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -93,7 +95,8 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = "application/json" ) @@ -134,7 +137,8 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = "application/json" ) @@ -175,7 +179,8 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tag @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = "application/json" ) @@ -216,7 +221,8 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = "application/json" ) @@ -241,7 +247,8 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) @@ -266,7 +273,8 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data" diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index 229a0ba4240a..baf8f889ab0a 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -43,7 +43,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("orderId") String orderId) { @@ -64,7 +65,8 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = "application/json" ) @@ -88,7 +90,8 @@ default ResponseEntity> getInventory() { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{orderId}", produces = "application/json" ) @@ -123,7 +126,8 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = "application/json" ) diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index e2d924590ee8..004ed5b32b55 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -41,7 +41,8 @@ default Optional getRequest() { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { @@ -59,7 +60,8 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -77,7 +79,8 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -98,7 +101,8 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { @@ -120,7 +124,8 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = "application/json" ) @@ -156,7 +161,8 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = "application/json" ) @@ -174,7 +180,8 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) default ResponseEntity logoutUser() { @@ -196,7 +203,8 @@ default ResponseEntity logoutUser() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt index 2880b39b990d..54b0f29888c0 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -50,7 +50,8 @@ interface PetApi { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 405, message = "Invalid input")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/pet"], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] @@ -67,7 +68,8 @@ interface PetApi { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid pet value")]) - @DeleteMapping( + @RequestMapping( + method = [RequestMethod.DELETE], value = ["/pet/{petId}"] ) fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long @@ -85,7 +87,8 @@ interface PetApi { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/pet/findByStatus"], produces = ["application/xml", "application/json"] ) @@ -103,7 +106,8 @@ interface PetApi { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/pet/findByTags"], produces = ["application/xml", "application/json"] ) @@ -120,7 +124,8 @@ interface PetApi { authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/pet/{petId}"], produces = ["application/xml", "application/json"] ) @@ -137,7 +142,8 @@ interface PetApi { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) - @PutMapping( + @RequestMapping( + method = [RequestMethod.PUT], value = ["/pet"], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] @@ -154,7 +160,8 @@ interface PetApi { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 405, message = "Invalid input")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/pet/{petId}"], consumes = ["application/x-www-form-urlencoded"] ) @@ -173,7 +180,8 @@ interface PetApi { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/pet/{petId}/uploadImage"], produces = ["application/json"], consumes = ["multipart/form-data"] diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt index 14a9d0fa525d..8896b92f5696 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -47,7 +47,8 @@ interface StoreApi { notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) - @DeleteMapping( + @RequestMapping( + method = [RequestMethod.DELETE], value = ["/store/order/{orderId}"] ) fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String @@ -64,7 +65,8 @@ interface StoreApi { authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/store/inventory"], produces = ["application/json"] ) @@ -79,7 +81,8 @@ interface StoreApi { response = Order::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/store/order/{orderId}"], produces = ["application/xml", "application/json"] ) @@ -95,7 +98,8 @@ interface StoreApi { response = Order::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/store/order"], produces = ["application/xml", "application/json"], consumes = ["application/json"] diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt index 233a3bb1a5f2..4917cbd5c5c5 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -48,7 +48,8 @@ interface UserApi { authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/user"], consumes = ["application/json"] ) @@ -64,7 +65,8 @@ interface UserApi { authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/user/createWithArray"], consumes = ["application/json"] ) @@ -80,7 +82,8 @@ interface UserApi { authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/user/createWithList"], consumes = ["application/json"] ) @@ -96,7 +99,8 @@ interface UserApi { authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) - @DeleteMapping( + @RequestMapping( + method = [RequestMethod.DELETE], value = ["/user/{username}"] ) fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String @@ -111,7 +115,8 @@ interface UserApi { response = User::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/user/{username}"], produces = ["application/xml", "application/json"] ) @@ -127,7 +132,8 @@ interface UserApi { response = kotlin.String::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/user/login"], produces = ["application/xml", "application/json"] ) @@ -144,7 +150,8 @@ interface UserApi { authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/user/logout"] ) fun logoutUser(): ResponseEntity { @@ -158,7 +165,8 @@ interface UserApi { authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) - @PutMapping( + @RequestMapping( + method = [RequestMethod.PUT], value = ["/user/{username}"], consumes = ["application/json"] ) diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt index 7ac18d95d843..8430a1333aaf 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -44,7 +44,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 405, message = "Invalid input")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/pet"], consumes = ["application/json", "application/xml"] ) @@ -60,7 +61,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid pet value")]) - @DeleteMapping( + @RequestMapping( + method = [RequestMethod.DELETE], value = ["/pet/{petId}"] ) suspend fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long @@ -78,7 +80,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/pet/findByStatus"], produces = ["application/xml", "application/json"] ) @@ -96,7 +99,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/pet/findByTags"], produces = ["application/xml", "application/json"] ) @@ -113,7 +117,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/pet/{petId}"], produces = ["application/xml", "application/json"] ) @@ -129,7 +134,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) - @PutMapping( + @RequestMapping( + method = [RequestMethod.PUT], value = ["/pet"], consumes = ["application/json", "application/xml"] ) @@ -145,7 +151,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 405, message = "Invalid input")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/pet/{petId}"], consumes = ["application/x-www-form-urlencoded"] ) @@ -164,7 +171,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/pet/{petId}/uploadImage"], produces = ["application/json"], consumes = ["multipart/form-data"] diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt index dde98ffba083..24dbff458d3f 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -42,7 +42,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) - @DeleteMapping( + @RequestMapping( + method = [RequestMethod.DELETE], value = ["/store/order/{orderId}"] ) suspend fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String @@ -59,7 +60,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/store/inventory"], produces = ["application/json"] ) @@ -74,7 +76,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic response = Order::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/store/order/{orderId}"], produces = ["application/xml", "application/json"] ) @@ -90,7 +93,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic response = Order::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/store/order"], produces = ["application/xml", "application/json"] ) diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt index d369aefe48c8..9881ade4a160 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -42,7 +42,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "This can only be done by the logged in user.") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/user"] ) suspend fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody body: User @@ -56,7 +57,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/user/createWithArray"] ) suspend fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody body: Flow @@ -70,7 +72,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/user/createWithList"] ) suspend fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody body: Flow @@ -84,7 +87,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "This can only be done by the logged in user.") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) - @DeleteMapping( + @RequestMapping( + method = [RequestMethod.DELETE], value = ["/user/{username}"] ) suspend fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String @@ -99,7 +103,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) response = User::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/user/{username}"], produces = ["application/xml", "application/json"] ) @@ -115,7 +120,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) response = kotlin.String::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/user/login"], produces = ["application/xml", "application/json"] ) @@ -131,7 +137,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/user/logout"] ) suspend fun logoutUser(): ResponseEntity { @@ -144,7 +151,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "This can only be done by the logged in user.") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) - @PutMapping( + @RequestMapping( + method = [RequestMethod.PUT], value = ["/user/{username}"] ) suspend fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: kotlin.String diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt index 9de503175ac7..a26504324da6 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -43,7 +43,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 405, message = "Invalid input")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/pet"], consumes = ["application/json", "application/xml"] ) @@ -59,7 +60,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid pet value")]) - @DeleteMapping( + @RequestMapping( + method = [RequestMethod.DELETE], value = ["/pet/{petId}"] ) fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long @@ -77,7 +79,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/pet/findByStatus"], produces = ["application/xml", "application/json"] ) @@ -95,7 +98,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/pet/findByTags"], produces = ["application/xml", "application/json"] ) @@ -112,7 +116,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/pet/{petId}"], produces = ["application/xml", "application/json"] ) @@ -128,7 +133,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) - @PutMapping( + @RequestMapping( + method = [RequestMethod.PUT], value = ["/pet"], consumes = ["application/json", "application/xml"] ) @@ -144,7 +150,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 405, message = "Invalid input")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/pet/{petId}"], consumes = ["application/x-www-form-urlencoded"] ) @@ -163,7 +170,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/pet/{petId}/uploadImage"], produces = ["application/json"], consumes = ["multipart/form-data"] diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt index 3b82141c4df5..e2be73b4ec33 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -41,7 +41,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) - @DeleteMapping( + @RequestMapping( + method = [RequestMethod.DELETE], value = ["/store/order/{orderId}"] ) fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String @@ -58,7 +59,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/store/inventory"], produces = ["application/json"] ) @@ -73,7 +75,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic response = Order::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/store/order/{orderId}"], produces = ["application/xml", "application/json"] ) @@ -89,7 +92,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic response = Order::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/store/order"], produces = ["application/xml", "application/json"] ) diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt index 7071afde110f..f7c4144fbdbe 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -41,7 +41,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "This can only be done by the logged in user.") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/user"] ) fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody body: User @@ -55,7 +56,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/user/createWithArray"] ) fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody body: kotlin.collections.List @@ -69,7 +71,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/user/createWithList"] ) fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody body: kotlin.collections.List @@ -83,7 +86,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "This can only be done by the logged in user.") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) - @DeleteMapping( + @RequestMapping( + method = [RequestMethod.DELETE], value = ["/user/{username}"] ) fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String @@ -98,7 +102,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) response = User::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/user/{username}"], produces = ["application/xml", "application/json"] ) @@ -114,7 +119,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) response = kotlin.String::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/user/login"], produces = ["application/xml", "application/json"] ) @@ -130,7 +136,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/user/logout"] ) fun logoutUser(): ResponseEntity { @@ -143,7 +150,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "This can only be done by the logged in user.") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) - @PutMapping( + @RequestMapping( + method = [RequestMethod.PUT], value = ["/user/{username}"] ) fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: kotlin.String diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java index 2d31a64a04d4..f236bbecd9f2 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java @@ -46,7 +46,8 @@ default Optional getRequest() { @ApiOperation(value = "test headers", nickname = "headersTest", notes = "desc", response = TestResponse.class, tags={ "verify-default-value", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "default response", response = TestResponse.class) }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/test-headers", produces = { "application/json" } ) diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java index a3f907809a00..210f0b0830d4 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java @@ -46,7 +46,8 @@ default Optional getRequest() { @ApiOperation(value = "test query params", nickname = "queryParamsTest", notes = "desc", response = TestResponse.class, tags={ "verify-default-value", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "default response", response = TestResponse.class) }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/test-query-params", produces = { "application/json" } ) diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java index 8326ab48c02c..31d749f78347 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -41,7 +41,8 @@ default Optional getRequest() { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index b301ad0b4855..f7f9157ff68c 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -50,7 +50,8 @@ default Optional getRequest() { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -70,7 +71,8 @@ default CompletableFuture> createXmlItem(@ApiParam(value = @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -90,7 +92,8 @@ default CompletableFuture> fakeOuterBooleanSerialize(@Ap @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -121,7 +124,8 @@ default CompletableFuture> fakeOuterCompositeSeri @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -141,7 +145,8 @@ default CompletableFuture> fakeOuterNumberSerialize(@ @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -161,7 +166,8 @@ default CompletableFuture> fakeOuterStringSerialize(@ApiP @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -181,7 +187,8 @@ default CompletableFuture> testBodyWithFileSchema(@ApiParam @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -201,7 +208,8 @@ default CompletableFuture> testBodyWithQueryParams(@NotNull @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -251,7 +259,8 @@ default CompletableFuture> testClientModel(@ApiParam(valu @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -280,7 +289,8 @@ default CompletableFuture> testEndpointParameters(@ApiParam @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -305,7 +315,8 @@ default CompletableFuture> testEnumParameters(@ApiParam(val @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/fake" ) default CompletableFuture> testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { @@ -323,7 +334,8 @@ default CompletableFuture> testGroupParameters(@NotNull @Ap @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -343,7 +355,8 @@ default CompletableFuture> testInlineAdditionalProperties(@ @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -367,7 +380,8 @@ default CompletableFuture> testJsonFormData(@ApiParam(value @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) default CompletableFuture> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { @@ -391,7 +405,8 @@ default CompletableFuture> testQueryParameterCollectionForm }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 3de6e0e21889..c36979ffb917 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -44,7 +44,8 @@ default Optional getRequest() { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java index f2512f9eac34..94f662e2c4da 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java @@ -48,7 +48,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -74,7 +75,8 @@ default CompletableFuture> addPet(@ApiParam(value = "Pet ob @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/pet/{petId}" ) default CompletableFuture> deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { @@ -99,7 +101,8 @@ default CompletableFuture> deletePet(@ApiParam(value = "Pet @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -142,7 +145,8 @@ default CompletableFuture>> findPetsByStatus(@NotNull @ @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -185,7 +189,8 @@ default CompletableFuture>> findPetsByTags(@NotNull @Api @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -230,7 +235,8 @@ default CompletableFuture> getPetById(@ApiParam(value = "ID @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -255,7 +261,8 @@ default CompletableFuture> updatePet(@ApiParam(value = "Pet }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -280,7 +287,8 @@ default CompletableFuture> updatePetWithForm(@ApiParam(valu }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java index 03fa53219d90..153b3c060508 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java @@ -44,7 +44,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) default CompletableFuture> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId) { @@ -65,7 +66,8 @@ default CompletableFuture> deleteOrder(@ApiParam(value = "I }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -89,7 +91,8 @@ default CompletableFuture>> getInventory() { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -126,7 +129,8 @@ default CompletableFuture> getOrderById(@Min(1L) @Max(5L) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java index bc349aa67c0f..0d75e5883c3d 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java @@ -42,7 +42,8 @@ default Optional getRequest() { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) default CompletableFuture> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { @@ -60,7 +61,8 @@ default CompletableFuture> createUser(@ApiParam(value = "Cr @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) default CompletableFuture> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -78,7 +80,8 @@ default CompletableFuture> createUsersWithArrayInput(@ApiPa @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) default CompletableFuture> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -99,7 +102,8 @@ default CompletableFuture> createUsersWithListInput(@ApiPar @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) default CompletableFuture> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { @@ -121,7 +125,8 @@ default CompletableFuture> deleteUser(@ApiParam(value = "Th @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -159,7 +164,8 @@ default CompletableFuture> getUserByName(@ApiParam(value = @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -177,7 +183,8 @@ default CompletableFuture> loginUser(@NotNull @ApiParam(v @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) default CompletableFuture> logoutUser() { @@ -199,7 +206,8 @@ default CompletableFuture> logoutUser() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/user/{username}" ) default CompletableFuture> updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java index 62b5e8c1c9ec..3038dbc9d926 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -40,7 +40,8 @@ default Optional getRequest() { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index 1d52ff9cf887..d674fa37223d 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -49,7 +49,8 @@ default Optional getRequest() { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -69,7 +70,8 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -89,7 +91,8 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -118,7 +121,8 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -138,7 +142,8 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -158,7 +163,8 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -178,7 +184,8 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -198,7 +205,8 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -246,7 +254,8 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -275,7 +284,8 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -300,7 +310,8 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + 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,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { @@ -318,7 +329,8 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -338,7 +350,8 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -362,7 +375,8 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { @@ -386,7 +400,8 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index ce5242fa1b93..943b3046fc2c 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -43,7 +43,8 @@ default Optional getRequest() { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java index 6c50971728c1..b71c9c9af2c1 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java @@ -47,7 +47,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -73,7 +74,8 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -98,7 +100,8 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -139,7 +142,8 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -180,7 +184,8 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -223,7 +228,8 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -248,7 +254,8 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -273,7 +280,8 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java index a18ef0803417..8baf5d3dd512 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java @@ -43,7 +43,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -64,7 +65,8 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -88,7 +90,8 @@ default ResponseEntity> getInventory() { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -123,7 +126,8 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java index bdd829c2178f..2a21822dae8b 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java @@ -41,7 +41,8 @@ default Optional getRequest() { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { @@ -59,7 +60,8 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -77,7 +79,8 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -98,7 +101,8 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { @@ -120,7 +124,8 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -156,7 +161,8 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -174,7 +180,8 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) default ResponseEntity logoutUser() { @@ -196,7 +203,8 @@ default ResponseEntity logoutUser() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index 62b5e8c1c9ec..3038dbc9d926 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -40,7 +40,8 @@ default Optional getRequest() { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 9c17aee08e3d..c9e602ddf8d4 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -49,7 +49,8 @@ default Optional getRequest() { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -69,7 +70,8 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -89,7 +91,8 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -118,7 +121,8 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -138,7 +142,8 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -158,7 +163,8 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -178,7 +184,8 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -198,7 +205,8 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -246,7 +254,8 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -275,7 +284,8 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -300,7 +310,8 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + 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,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { @@ -318,7 +329,8 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -338,7 +350,8 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -362,7 +375,8 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { @@ -386,7 +400,8 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index ce5242fa1b93..943b3046fc2c 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -43,7 +43,8 @@ default Optional getRequest() { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java index 6c50971728c1..b71c9c9af2c1 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -47,7 +47,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -73,7 +74,8 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -98,7 +100,8 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -139,7 +142,8 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -180,7 +184,8 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -223,7 +228,8 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -248,7 +254,8 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -273,7 +280,8 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index a18ef0803417..8baf5d3dd512 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -43,7 +43,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -64,7 +65,8 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -88,7 +90,8 @@ default ResponseEntity> getInventory() { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -123,7 +126,8 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java index bdd829c2178f..2a21822dae8b 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -41,7 +41,8 @@ default Optional getRequest() { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { @@ -59,7 +60,8 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -77,7 +79,8 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -98,7 +101,8 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { @@ -120,7 +124,8 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -156,7 +161,8 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -174,7 +180,8 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) default ResponseEntity logoutUser() { @@ -196,7 +203,8 @@ default ResponseEntity logoutUser() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index 62b5e8c1c9ec..3038dbc9d926 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -40,7 +40,8 @@ default Optional getRequest() { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index b0b57f815bd6..1118b4aaa94c 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -49,7 +49,8 @@ default Optional getRequest() { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -69,7 +70,8 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -89,7 +91,8 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -118,7 +121,8 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -138,7 +142,8 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -158,7 +163,8 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -178,7 +184,8 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -198,7 +205,8 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -246,7 +254,8 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -275,7 +284,8 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -300,7 +310,8 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + 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,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { @@ -318,7 +329,8 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -338,7 +350,8 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -362,7 +375,8 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { @@ -386,7 +400,8 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index ce5242fa1b93..943b3046fc2c 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -43,7 +43,8 @@ default Optional getRequest() { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index 2e67f9eb6099..06b14e28f5c5 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -46,7 +46,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -72,7 +73,8 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -97,7 +99,8 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -138,7 +141,8 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -179,7 +183,8 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tag @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -222,7 +227,8 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -247,7 +253,8 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -272,7 +279,8 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index a18ef0803417..8baf5d3dd512 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -43,7 +43,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -64,7 +65,8 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -88,7 +90,8 @@ default ResponseEntity> getInventory() { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -123,7 +126,8 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index bdd829c2178f..2a21822dae8b 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -41,7 +41,8 @@ default Optional getRequest() { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { @@ -59,7 +60,8 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -77,7 +79,8 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -98,7 +101,8 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { @@ -120,7 +124,8 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -156,7 +161,8 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -174,7 +180,8 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) default ResponseEntity logoutUser() { @@ -196,7 +203,8 @@ default ResponseEntity logoutUser() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java index 62b5e8c1c9ec..3038dbc9d926 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -40,7 +40,8 @@ default Optional getRequest() { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index 9c17aee08e3d..c9e602ddf8d4 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -49,7 +49,8 @@ default Optional getRequest() { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -69,7 +70,8 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -89,7 +91,8 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -118,7 +121,8 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -138,7 +142,8 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -158,7 +163,8 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -178,7 +184,8 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -198,7 +205,8 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -246,7 +254,8 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -275,7 +284,8 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -300,7 +310,8 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + 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,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { @@ -318,7 +329,8 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -338,7 +350,8 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -362,7 +375,8 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { @@ -386,7 +400,8 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index ce5242fa1b93..943b3046fc2c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -43,7 +43,8 @@ default Optional getRequest() { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java index 6c50971728c1..b71c9c9af2c1 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java @@ -47,7 +47,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -73,7 +74,8 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -98,7 +100,8 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -139,7 +142,8 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -180,7 +184,8 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -223,7 +228,8 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -248,7 +254,8 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -273,7 +280,8 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java index a18ef0803417..8baf5d3dd512 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java @@ -43,7 +43,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -64,7 +65,8 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -88,7 +90,8 @@ default ResponseEntity> getInventory() { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -123,7 +126,8 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java index bdd829c2178f..2a21822dae8b 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java @@ -41,7 +41,8 @@ default Optional getRequest() { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { @@ -59,7 +60,8 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -77,7 +79,8 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -98,7 +101,8 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { @@ -120,7 +124,8 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -156,7 +161,8 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -174,7 +180,8 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) default ResponseEntity logoutUser() { @@ -196,7 +203,8 @@ default ResponseEntity logoutUser() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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-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 dfae7d61930c..4c1d31e0a665 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 @@ -32,7 +32,8 @@ public interface AnotherFakeApi { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } 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 68cec85a19ab..efc02ef10534 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 @@ -41,7 +41,8 @@ public interface FakeApi { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -58,7 +59,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -75,7 +77,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -92,7 +95,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -109,7 +113,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -126,7 +131,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -143,7 +149,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -160,7 +167,8 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -196,7 +204,8 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -222,7 +231,8 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -244,7 +254,8 @@ public interface FakeApi { @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/fake" ) ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); @@ -259,7 +270,8 @@ public interface FakeApi { @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -276,7 +288,8 @@ public interface FakeApi { @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -297,7 +310,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context); @@ -318,7 +332,8 @@ public interface FakeApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 d2215dd0d1be..829637cf78d4 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 @@ -35,7 +35,8 @@ public interface FakeClassnameTestApi { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } 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 b9655c2c700f..326c6f0520de 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 @@ -39,7 +39,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -62,7 +63,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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); @@ -84,7 +86,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -108,7 +111,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -132,7 +136,8 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -158,7 +163,8 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -180,7 +186,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -202,7 +209,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 69c047f7c677..7276699ea25f 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 @@ -35,7 +35,8 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId); @@ -53,7 +54,8 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -74,7 +76,8 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -92,7 +95,8 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) 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 972cc8bc4682..a20a6ae61854 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 @@ -33,7 +33,8 @@ public interface UserApi { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body); @@ -48,7 +49,8 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -63,7 +65,8 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -81,7 +84,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username); @@ -100,7 +104,8 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -119,7 +124,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -134,7 +140,8 @@ public interface UserApi { @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) ResponseEntity logoutUser(); @@ -153,7 +160,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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/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 62b5e8c1c9ec..3038dbc9d926 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 @@ -40,7 +40,8 @@ default Optional getRequest() { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } 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 9c17aee08e3d..c9e602ddf8d4 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 @@ -49,7 +49,8 @@ default Optional getRequest() { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -69,7 +70,8 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -89,7 +91,8 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -118,7 +121,8 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -138,7 +142,8 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -158,7 +163,8 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -178,7 +184,8 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -198,7 +205,8 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -246,7 +254,8 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -275,7 +284,8 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -300,7 +310,8 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + 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,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { @@ -318,7 +329,8 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -338,7 +350,8 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -362,7 +375,8 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { @@ -386,7 +400,8 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 ce5242fa1b93..943b3046fc2c 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 @@ -43,7 +43,8 @@ default Optional getRequest() { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } 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 6c50971728c1..b71c9c9af2c1 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 @@ -47,7 +47,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -73,7 +74,8 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -98,7 +100,8 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -139,7 +142,8 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -180,7 +184,8 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -223,7 +228,8 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -248,7 +254,8 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -273,7 +280,8 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 a18ef0803417..8baf5d3dd512 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 @@ -43,7 +43,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -64,7 +65,8 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -88,7 +90,8 @@ default ResponseEntity> getInventory() { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -123,7 +126,8 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) 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 bdd829c2178f..2a21822dae8b 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 @@ -41,7 +41,8 @@ default Optional getRequest() { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { @@ -59,7 +60,8 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -77,7 +79,8 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -98,7 +101,8 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { @@ -120,7 +124,8 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -156,7 +161,8 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -174,7 +180,8 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) default ResponseEntity logoutUser() { @@ -196,7 +203,8 @@ default ResponseEntity logoutUser() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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-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 f4afb63f6185..4a0e3f0f2d4e 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 @@ -36,7 +36,8 @@ default AnotherFakeApiDelegate getDelegate() { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } 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 f085be2317d2..d4810e87bd9a 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 @@ -45,7 +45,8 @@ default FakeApiDelegate getDelegate() { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -64,7 +65,8 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -83,7 +85,8 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -102,7 +105,8 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -121,7 +125,8 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -140,7 +145,8 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -159,7 +165,8 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -178,7 +185,8 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -216,7 +224,8 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -244,7 +253,8 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -268,7 +278,8 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + 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,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { @@ -285,7 +296,8 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -304,7 +316,8 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -327,7 +340,8 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { @@ -350,7 +364,8 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 572b49ba2a94..dac483c9d1cf 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 @@ -39,7 +39,8 @@ default FakeClassnameTestApiDelegate getDelegate() { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } 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 b7a84c916cfb..6221a183c008 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 @@ -43,7 +43,8 @@ default PetApiDelegate getDelegate() { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -68,7 +69,8 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -92,7 +94,8 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -118,7 +121,8 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -144,7 +148,8 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -172,7 +177,8 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -196,7 +202,8 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -220,7 +227,8 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 05cfb8f5758a..ed839cee4b75 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 @@ -39,7 +39,8 @@ default StoreApiDelegate getDelegate() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -59,7 +60,8 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -82,7 +84,8 @@ default ResponseEntity> getInventory() { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -102,7 +105,8 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) 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 5b3512235937..3974cf49c147 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 @@ -37,7 +37,8 @@ default UserApiDelegate getDelegate() { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { @@ -54,7 +55,8 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -71,7 +73,8 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -91,7 +94,8 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { @@ -112,7 +116,8 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -133,7 +138,8 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -150,7 +156,8 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) default ResponseEntity logoutUser() { @@ -171,7 +178,8 @@ default ResponseEntity logoutUser() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index f4afb63f6185..4a0e3f0f2d4e 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 @@ -36,7 +36,8 @@ default AnotherFakeApiDelegate getDelegate() { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } 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 f085be2317d2..d4810e87bd9a 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 @@ -45,7 +45,8 @@ default FakeApiDelegate getDelegate() { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -64,7 +65,8 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -83,7 +85,8 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -102,7 +105,8 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -121,7 +125,8 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -140,7 +145,8 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -159,7 +165,8 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -178,7 +185,8 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -216,7 +224,8 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -244,7 +253,8 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -268,7 +278,8 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + 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,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { @@ -285,7 +296,8 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -304,7 +316,8 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -327,7 +340,8 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { @@ -350,7 +364,8 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 572b49ba2a94..dac483c9d1cf 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 @@ -39,7 +39,8 @@ default FakeClassnameTestApiDelegate getDelegate() { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } 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 b7a84c916cfb..6221a183c008 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 @@ -43,7 +43,8 @@ default PetApiDelegate getDelegate() { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -68,7 +69,8 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -92,7 +94,8 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -118,7 +121,8 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -144,7 +148,8 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -172,7 +177,8 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -196,7 +202,8 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -220,7 +227,8 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 05cfb8f5758a..ed839cee4b75 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 @@ -39,7 +39,8 @@ default StoreApiDelegate getDelegate() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -59,7 +60,8 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -82,7 +84,8 @@ default ResponseEntity> getInventory() { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -102,7 +105,8 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) 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 5b3512235937..3974cf49c147 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 @@ -37,7 +37,8 @@ default UserApiDelegate getDelegate() { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { @@ -54,7 +55,8 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -71,7 +73,8 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -91,7 +94,8 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { @@ -112,7 +116,8 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -133,7 +138,8 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -150,7 +156,8 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) default ResponseEntity logoutUser() { @@ -171,7 +178,8 @@ default ResponseEntity logoutUser() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index 0fa0742fe83a..e8504ff5c8fe 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 @@ -42,7 +42,8 @@ default Optional getRequest() { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @ApiImplicitParams({ }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index e985e37bc09e..4248c2d4763a 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 @@ -51,7 +51,8 @@ default Optional getRequest() { @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -73,7 +74,8 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @ApiImplicitParams({ }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -95,7 +97,8 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @ApiImplicitParams({ }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -126,7 +129,8 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @ApiImplicitParams({ }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -148,7 +152,8 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I @ApiResponse(code = 200, message = "Output string", response = String.class) }) @ApiImplicitParams({ }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -170,7 +175,8 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input @ApiResponse(code = 200, message = "Success") }) @ApiImplicitParams({ }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -192,7 +198,8 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir @ApiResponse(code = 200, message = "Success") }) @ApiImplicitParams({ }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -214,7 +221,8 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @ApiImplicitParams({ }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -264,7 +272,8 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" @ApiResponse(code = 404, message = "User not found") }) @ApiImplicitParams({ }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -295,7 +304,8 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re @ApiImplicitParam(name = "enumHeaderStringArray", value = "Header parameter enum test (string array)", dataType = "List", paramType = "header"), @ApiImplicitParam(name = "enumHeaderString", value = "Header parameter enum test (string)", dataType = "String", paramType = "header") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -322,7 +332,8 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Query paramet @ApiImplicitParam(name = "requiredBooleanGroup", value = "Required Boolean in group parameters", required=true, dataType = "Boolean", paramType = "header"), @ApiImplicitParam(name = "booleanGroup", value = "Boolean in group parameters", dataType = "Boolean", paramType = "header") }) - @DeleteMapping( + @RequestMapping( + 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,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { @@ -342,7 +353,8 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -364,7 +376,8 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -390,7 +403,8 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir @ApiResponse(code = 200, message = "Success") }) @ApiImplicitParams({ }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { @@ -416,7 +430,8 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @ApiImplicitParams({ }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 3d7f2e2ea285..215a46506102 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 @@ -45,7 +45,8 @@ default Optional getRequest() { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @ApiImplicitParams({ }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 209a72ff9778..e63c8458d232 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 @@ -49,7 +49,8 @@ default Optional getRequest() { @ApiResponse(code = 405, message = "Invalid input") }) @ApiImplicitParams({ }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -77,7 +78,8 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to @ApiImplicitParams({ @ApiImplicitParam(name = "apiKey", value = "", dataType = "String", paramType = "header") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/pet/{petId}" ) default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId) { @@ -104,7 +106,8 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ @ApiResponse(code = 400, message = "Invalid status value") }) @ApiImplicitParams({ }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -147,7 +150,8 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S @ApiResponse(code = 400, message = "Invalid tag value") }) @ApiImplicitParams({ }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -190,7 +194,8 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags @ApiResponse(code = 404, message = "Pet not found") }) @ApiImplicitParams({ }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -235,7 +240,8 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r @ApiResponse(code = 405, message = "Validation exception") }) @ApiImplicitParams({ }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -262,7 +268,8 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs @ApiResponse(code = 405, message = "Invalid input") }) @ApiImplicitParams({ }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -289,7 +296,8 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @ApiImplicitParams({ }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 94057aa6fc58..2383a0ae8e8c 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 @@ -45,7 +45,8 @@ default Optional getRequest() { @ApiResponse(code = 404, message = "Order not found") }) @ApiImplicitParams({ }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -68,7 +69,8 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @ApiImplicitParams({ }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -94,7 +96,8 @@ default ResponseEntity> getInventory() { @ApiResponse(code = 404, message = "Order not found") }) @ApiImplicitParams({ }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -131,7 +134,8 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " @ApiResponse(code = 400, message = "Invalid Order") }) @ApiImplicitParams({ }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index b60e3580cf6b..4b3d0e8e3321 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 @@ -43,7 +43,8 @@ default Optional getRequest() { @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { @@ -63,7 +64,8 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -83,7 +85,8 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -106,7 +109,8 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of @ApiResponse(code = 404, message = "User not found") }) @ApiImplicitParams({ }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { @@ -130,7 +134,8 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t @ApiResponse(code = 404, message = "User not found") }) @ApiImplicitParams({ }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -168,7 +173,8 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @ApiImplicitParams({ }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -188,7 +194,8 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) default ResponseEntity logoutUser() { @@ -212,7 +219,8 @@ default ResponseEntity logoutUser() { @ApiResponse(code = 404, message = "User not found") }) @ApiImplicitParams({ }) - @PutMapping( + @RequestMapping( + 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-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index eea35ce51b89..2b3a6c7d0da6 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 @@ -40,7 +40,8 @@ default AnotherFakeApiDelegate getDelegate() { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } 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 33228158d4d3..9cc8a860e93d 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 @@ -49,7 +49,8 @@ default FakeApiDelegate getDelegate() { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -68,7 +69,8 @@ default Mono> createXmlItem(@ApiParam(value = "XmlItem Body @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -87,7 +89,8 @@ default Mono> fakeOuterBooleanSerialize(@ApiParam(value @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -106,7 +109,8 @@ default Mono> fakeOuterCompositeSerialize(@ApiPar @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -125,7 +129,8 @@ default Mono> fakeOuterNumberSerialize(@ApiParam(valu @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -144,7 +149,8 @@ default Mono> fakeOuterStringSerialize(@ApiParam(value = @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -163,7 +169,8 @@ default Mono> testBodyWithFileSchema(@ApiParam(value = "" , @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -182,7 +189,8 @@ default Mono> testBodyWithQueryParams(@NotNull @ApiParam(va @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -220,7 +228,8 @@ default Mono> testClientModel(@ApiParam(value = "client m @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -248,7 +257,8 @@ default Mono> testEndpointParameters(@ApiParam(value = "Non @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -272,7 +282,8 @@ default Mono> testEnumParameters(@ApiParam(value = "Header @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + 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,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group, @ApiIgnore final ServerWebExchange exchange) { @@ -289,7 +300,8 @@ default Mono> testGroupParameters(@NotNull @ApiParam(value @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -308,7 +320,8 @@ default Mono> testInlineAdditionalProperties(@ApiParam(valu @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -331,7 +344,8 @@ default Mono> testJsonFormData(@ApiParam(value = "field1", @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) default Mono> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context, @ApiIgnore final ServerWebExchange exchange) { @@ -354,7 +368,8 @@ default Mono> testQueryParameterCollectionFormat(@NotNull @ }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 15b48f22a526..08bd8b24e41c 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 @@ -43,7 +43,8 @@ default FakeClassnameTestApiDelegate getDelegate() { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } 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 41ed1eeccd35..8e0f69665213 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 @@ -47,7 +47,8 @@ default PetApiDelegate getDelegate() { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -72,7 +73,8 @@ default Mono> addPet(@ApiParam(value = "Pet object that nee @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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, @ApiIgnore final ServerWebExchange exchange) { @@ -96,7 +98,8 @@ default Mono> deletePet(@ApiParam(value = "Pet id to delete @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -122,7 +125,8 @@ default Mono>> findPetsByStatus(@NotNull @ApiParam(valu @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -148,7 +152,8 @@ default Mono>> findPetsByTags(@NotNull @ApiParam(value @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -176,7 +181,8 @@ default Mono> getPetById(@ApiParam(value = "ID of pet to ret @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -200,7 +206,8 @@ default Mono> updatePet(@ApiParam(value = "Pet object that }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -224,7 +231,8 @@ default Mono> updatePetWithForm(@ApiParam(value = "ID of pe }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 520c688e3fa4..dc70f006fe86 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 @@ -43,7 +43,8 @@ default StoreApiDelegate getDelegate() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -63,7 +64,8 @@ default Mono> deleteOrder(@ApiParam(value = "ID of the orde }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -86,7 +88,8 @@ default Mono>> getInventory(@ApiIgnore final @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -106,7 +109,8 @@ default Mono> getOrderById(@Min(1L) @Max(5L) @ApiParam(val @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) 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 2f3e0a55c9bd..f378c07fe6c7 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 @@ -41,7 +41,8 @@ default UserApiDelegate getDelegate() { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) default Mono> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody Mono body, @ApiIgnore final ServerWebExchange exchange) { @@ -58,7 +59,8 @@ default Mono> createUser(@ApiParam(value = "Created user ob @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) default Mono> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody Flux body, @ApiIgnore final ServerWebExchange exchange) { @@ -75,7 +77,8 @@ default Mono> createUsersWithArrayInput(@ApiParam(value = " @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) default Mono> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody Flux body, @ApiIgnore final ServerWebExchange exchange) { @@ -95,7 +98,8 @@ default Mono> createUsersWithListInput(@ApiParam(value = "L @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -116,7 +120,8 @@ default Mono> deleteUser(@ApiParam(value = "The name that n @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -137,7 +142,8 @@ default Mono> getUserByName(@ApiParam(value = "The name tha @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -154,7 +160,8 @@ default Mono> loginUser(@NotNull @ApiParam(value = "The u @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) default Mono> logoutUser(@ApiIgnore final ServerWebExchange exchange) { @@ -175,7 +182,8 @@ default Mono> logoutUser(@ApiIgnore final ServerWebExchange @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/user/{username}" ) default Mono> updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody Mono body, @ApiIgnore final ServerWebExchange exchange) { 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 dfae7d61930c..4c1d31e0a665 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 @@ -32,7 +32,8 @@ public interface AnotherFakeApi { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } 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 54e73fc876d0..031464bcad4e 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 @@ -41,7 +41,8 @@ public interface FakeApi { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -58,7 +59,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -75,7 +77,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -92,7 +95,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -109,7 +113,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -126,7 +131,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -143,7 +149,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -160,7 +167,8 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -196,7 +204,8 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -222,7 +231,8 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -244,7 +254,8 @@ public interface FakeApi { @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/fake" ) ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); @@ -259,7 +270,8 @@ public interface FakeApi { @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -276,7 +288,8 @@ public interface FakeApi { @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -297,7 +310,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context); @@ -318,7 +332,8 @@ public interface FakeApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 d2215dd0d1be..829637cf78d4 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 @@ -35,7 +35,8 @@ public interface FakeClassnameTestApi { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } 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 dcdb633acf62..673c52007d36 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 @@ -38,7 +38,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -61,7 +62,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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); @@ -83,7 +85,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -107,7 +110,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -131,7 +135,8 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -157,7 +162,8 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -179,7 +185,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -201,7 +208,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 69c047f7c677..7276699ea25f 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 @@ -35,7 +35,8 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId); @@ -53,7 +54,8 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -74,7 +76,8 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -92,7 +95,8 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) 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 972cc8bc4682..a20a6ae61854 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 @@ -33,7 +33,8 @@ public interface UserApi { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body); @@ -48,7 +49,8 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -63,7 +65,8 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -81,7 +84,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username); @@ -100,7 +104,8 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -119,7 +124,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -134,7 +140,8 @@ public interface UserApi { @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) ResponseEntity logoutUser(); @@ -153,7 +160,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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/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 f4afb63f6185..4a0e3f0f2d4e 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 @@ -36,7 +36,8 @@ default AnotherFakeApiDelegate getDelegate() { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } 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 02a920c8bf8b..d7fe4f3c60c4 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 @@ -45,7 +45,8 @@ default FakeApiDelegate getDelegate() { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -64,7 +65,8 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -83,7 +85,8 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -102,7 +105,8 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -121,7 +125,8 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -140,7 +145,8 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -159,7 +165,8 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -178,7 +185,8 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -216,7 +224,8 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -244,7 +253,8 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -268,7 +278,8 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + 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,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { @@ -285,7 +296,8 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -304,7 +316,8 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -327,7 +340,8 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { @@ -350,7 +364,8 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 572b49ba2a94..dac483c9d1cf 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 @@ -39,7 +39,8 @@ default FakeClassnameTestApiDelegate getDelegate() { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } 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 0e5bdeffced3..bc9f1a940151 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 @@ -42,7 +42,8 @@ default PetApiDelegate getDelegate() { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -67,7 +68,8 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -91,7 +93,8 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -117,7 +120,8 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -143,7 +147,8 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tag @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -171,7 +176,8 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -195,7 +201,8 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -219,7 +226,8 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 05cfb8f5758a..ed839cee4b75 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 @@ -39,7 +39,8 @@ default StoreApiDelegate getDelegate() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -59,7 +60,8 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -82,7 +84,8 @@ default ResponseEntity> getInventory() { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -102,7 +105,8 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) 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 5b3512235937..3974cf49c147 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 @@ -37,7 +37,8 @@ default UserApiDelegate getDelegate() { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { @@ -54,7 +55,8 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -71,7 +73,8 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -91,7 +94,8 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { @@ -112,7 +116,8 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -133,7 +138,8 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -150,7 +156,8 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) default ResponseEntity logoutUser() { @@ -171,7 +178,8 @@ default ResponseEntity logoutUser() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index dfae7d61930c..4c1d31e0a665 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 @@ -32,7 +32,8 @@ public interface AnotherFakeApi { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } 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 54e73fc876d0..031464bcad4e 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 @@ -41,7 +41,8 @@ public interface FakeApi { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -58,7 +59,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -75,7 +77,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -92,7 +95,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -109,7 +113,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -126,7 +131,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -143,7 +149,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -160,7 +167,8 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -196,7 +204,8 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -222,7 +231,8 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -244,7 +254,8 @@ public interface FakeApi { @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/fake" ) ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); @@ -259,7 +270,8 @@ public interface FakeApi { @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -276,7 +288,8 @@ public interface FakeApi { @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -297,7 +310,8 @@ public interface FakeApi { @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context); @@ -318,7 +332,8 @@ public interface FakeApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 d2215dd0d1be..829637cf78d4 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 @@ -35,7 +35,8 @@ public interface FakeClassnameTestApi { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } 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 dcdb633acf62..673c52007d36 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 @@ -38,7 +38,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -61,7 +62,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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); @@ -83,7 +85,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -107,7 +110,8 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -131,7 +135,8 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -157,7 +162,8 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -179,7 +185,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -201,7 +208,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 69c047f7c677..7276699ea25f 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 @@ -35,7 +35,8 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId); @@ -53,7 +54,8 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -74,7 +76,8 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -92,7 +95,8 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) 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 972cc8bc4682..a20a6ae61854 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 @@ -33,7 +33,8 @@ public interface UserApi { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body); @@ -48,7 +49,8 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -63,7 +65,8 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -81,7 +84,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username); @@ -100,7 +104,8 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -119,7 +124,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -134,7 +140,8 @@ public interface UserApi { @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) ResponseEntity logoutUser(); @@ -153,7 +160,8 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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/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 62b5e8c1c9ec..3038dbc9d926 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 @@ -40,7 +40,8 @@ default Optional getRequest() { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } 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 b0b57f815bd6..1118b4aaa94c 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 @@ -49,7 +49,8 @@ default Optional getRequest() { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -69,7 +70,8 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -89,7 +91,8 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -118,7 +121,8 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -138,7 +142,8 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -158,7 +163,8 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -178,7 +184,8 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -198,7 +205,8 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -246,7 +254,8 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -275,7 +284,8 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -300,7 +310,8 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + 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,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { @@ -318,7 +329,8 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -338,7 +350,8 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -362,7 +375,8 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { @@ -386,7 +400,8 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 ce5242fa1b93..943b3046fc2c 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 @@ -43,7 +43,8 @@ default Optional getRequest() { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } 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 2e67f9eb6099..06b14e28f5c5 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 @@ -46,7 +46,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -72,7 +73,8 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -97,7 +99,8 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -138,7 +141,8 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -179,7 +183,8 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tag @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -222,7 +227,8 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -247,7 +253,8 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -272,7 +279,8 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 a18ef0803417..8baf5d3dd512 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 @@ -43,7 +43,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -64,7 +65,8 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -88,7 +90,8 @@ default ResponseEntity> getInventory() { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -123,7 +126,8 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) 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 bdd829c2178f..2a21822dae8b 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 @@ -41,7 +41,8 @@ default Optional getRequest() { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { @@ -59,7 +60,8 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -77,7 +79,8 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -98,7 +101,8 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { @@ -120,7 +124,8 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -156,7 +161,8 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -174,7 +180,8 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) default ResponseEntity logoutUser() { @@ -196,7 +203,8 @@ default ResponseEntity logoutUser() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index 62b5e8c1c9ec..3038dbc9d926 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 @@ -40,7 +40,8 @@ default Optional getRequest() { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 5360eef212b6..842c9c9b7c5a 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 @@ -49,7 +49,8 @@ default Optional getRequest() { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -69,7 +70,8 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -89,7 +91,8 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -118,7 +121,8 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -138,7 +142,8 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -158,7 +163,8 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -178,7 +184,8 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -198,7 +205,8 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -246,7 +254,8 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -275,7 +284,8 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -300,7 +310,8 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + 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,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Optional stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Optional booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Optional int64Group) { @@ -318,7 +329,8 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -338,7 +350,8 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -362,7 +375,8 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { @@ -386,7 +400,8 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 ce5242fa1b93..943b3046fc2c 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 @@ -43,7 +43,8 @@ default Optional getRequest() { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index 581c9ec1d36f..376e91080cad 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 @@ -47,7 +47,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -73,7 +74,8 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -98,7 +100,8 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -139,7 +142,8 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -180,7 +184,8 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -223,7 +228,8 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -248,7 +254,8 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -273,7 +280,8 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 a18ef0803417..8baf5d3dd512 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 @@ -43,7 +43,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -64,7 +65,8 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -88,7 +90,8 @@ default ResponseEntity> getInventory() { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -123,7 +126,8 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index bdd829c2178f..2a21822dae8b 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 @@ -41,7 +41,8 @@ default Optional getRequest() { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { @@ -59,7 +60,8 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -77,7 +79,8 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -98,7 +101,8 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { @@ -120,7 +124,8 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -156,7 +161,8 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -174,7 +180,8 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) default ResponseEntity logoutUser() { @@ -196,7 +203,8 @@ default ResponseEntity logoutUser() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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-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 5ba806e0898f..5e70f6ea6867 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 @@ -44,7 +44,8 @@ default Optional getRequest() { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index b3dcb0a94008..71342349c342 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 @@ -53,7 +53,8 @@ default Optional getRequest() { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -74,7 +75,8 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -95,7 +97,8 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -125,7 +128,8 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -146,7 +150,8 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -167,7 +172,8 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -188,7 +194,8 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -209,7 +216,8 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -258,7 +266,8 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -288,7 +297,8 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -314,7 +324,8 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + 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,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { @@ -333,7 +344,8 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -354,7 +366,8 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -379,7 +392,8 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { @@ -404,7 +418,8 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 a963e3199694..c50107142a09 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 @@ -47,7 +47,8 @@ default Optional getRequest() { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index a83c6d8326d2..0fc032f88392 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 @@ -51,7 +51,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -78,7 +79,8 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -104,7 +106,8 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -146,7 +149,8 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -188,7 +192,8 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -232,7 +237,8 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -258,7 +264,8 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -284,7 +291,8 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 e9cd51627cd0..afbfc4c9f9d8 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 @@ -47,7 +47,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -69,7 +70,8 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -94,7 +96,8 @@ default ResponseEntity> getInventory() { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -130,7 +133,8 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index d730f7e2ab01..5e1fc040ff72 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 @@ -45,7 +45,8 @@ default Optional getRequest() { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { @@ -64,7 +65,8 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -83,7 +85,8 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -105,7 +108,8 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { @@ -128,7 +132,8 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -165,7 +170,8 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -184,7 +190,8 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) default ResponseEntity logoutUser() { @@ -207,7 +214,8 @@ default ResponseEntity logoutUser() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index 62b5e8c1c9ec..3038dbc9d926 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 @@ -40,7 +40,8 @@ default Optional getRequest() { @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 9c17aee08e3d..c9e602ddf8d4 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 @@ -49,7 +49,8 @@ default Optional getRequest() { @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, 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" } ) @@ -69,7 +70,8 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/boolean", produces = { "*/*" } ) @@ -89,7 +91,8 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) @@ -118,7 +121,8 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/number", produces = { "*/*" } ) @@ -138,7 +142,8 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/outer/string", produces = { "*/*" } ) @@ -158,7 +163,8 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-file-schema", consumes = { "application/json" } ) @@ -178,7 +184,8 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/body-with-query-params", consumes = { "application/json" } ) @@ -198,7 +205,8 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake", produces = { "application/json" }, consumes = { "application/json" } @@ -246,7 +254,8 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -275,7 +284,8 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) @@ -300,7 +310,8 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - @DeleteMapping( + @RequestMapping( + 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,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { @@ -318,7 +329,8 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) @@ -338,7 +350,8 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) @@ -362,7 +375,8 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/fake/test-query-paramters" ) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { @@ -386,7 +400,8 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 ce5242fa1b93..943b3046fc2c 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 @@ -43,7 +43,8 @@ default Optional getRequest() { }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @PatchMapping( + @RequestMapping( + method = RequestMethod.PATCH, value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index 6c50971728c1..b71c9c9af2c1 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 @@ -47,7 +47,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -73,7 +74,8 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -98,7 +100,8 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) @@ -139,7 +142,8 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) @@ -180,7 +184,8 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) @@ -223,7 +228,8 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - @PutMapping( + @RequestMapping( + method = RequestMethod.PUT, value = "/pet", consumes = { "application/json", "application/xml" } ) @@ -248,7 +254,8 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) @@ -273,7 +280,8 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" } 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 a18ef0803417..8baf5d3dd512 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 @@ -43,7 +43,8 @@ default Optional getRequest() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @DeleteMapping( + @RequestMapping( + 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) { @@ -64,7 +65,8 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/inventory", produces = { "application/json" } ) @@ -88,7 +90,8 @@ default ResponseEntity> getInventory() { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) @@ -123,7 +126,8 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/store/order", produces = { "application/xml", "application/json" } ) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index bdd829c2178f..2a21822dae8b 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 @@ -41,7 +41,8 @@ default Optional getRequest() { @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user" ) default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { @@ -59,7 +60,8 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -77,7 +79,8 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @PostMapping( + @RequestMapping( + method = RequestMethod.POST, value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { @@ -98,7 +101,8 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @DeleteMapping( + @RequestMapping( + method = RequestMethod.DELETE, value = "/user/{username}" ) default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { @@ -120,7 +124,8 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @@ -156,7 +161,8 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @@ -174,7 +180,8 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - @GetMapping( + @RequestMapping( + method = RequestMethod.GET, value = "/user/logout" ) default ResponseEntity logoutUser() { @@ -196,7 +203,8 @@ default ResponseEntity logoutUser() { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - @PutMapping( + @RequestMapping( + 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) {