diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java index 0860e750a13..5cac886b443 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java @@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; import java.util.List; -import java.util.concurrent.Callable; +import java.util.concurrent.CompletableFuture; @Api(value = "pet", description = "the pet API") @@ -35,9 +35,9 @@ public interface PetApi { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) - default Callable> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body) { + default CompletableFuture> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body) { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -52,10 +52,9 @@ public interface PetApi { @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - default Callable> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { + default CompletableFuture> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -71,9 +70,9 @@ public interface PetApi { @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default Callable>> findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true) @RequestParam(value = "status", required = true) List status) { + default CompletableFuture>> findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true) @RequestParam(value = "status", required = true) List status) { // do some magic! - return () -> new ResponseEntity>(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity>(HttpStatus.OK)); } @@ -89,9 +88,9 @@ public interface PetApi { @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default Callable>> findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags) { + default CompletableFuture>> findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags) { // do some magic! - return () -> new ResponseEntity>(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity>(HttpStatus.OK)); } @@ -105,9 +104,9 @@ public interface PetApi { @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default Callable> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId) { + default CompletableFuture> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId) { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -125,9 +124,9 @@ public interface PetApi { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) - default Callable> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body) { + default CompletableFuture> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body) { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -143,11 +142,9 @@ public interface PetApi { produces = { "application/xml", "application/json" }, consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - default Callable> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, - @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status) { + default CompletableFuture> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status) { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -163,11 +160,9 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default Callable> uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, - @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) { + default CompletableFuture> uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java index 763342b3227..05d94900cd5 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java @@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; import java.util.List; -import java.util.concurrent.Callable; +import java.util.concurrent.CompletableFuture; @Api(value = "store", description = "the store API") @@ -29,9 +29,9 @@ public interface StoreApi { @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - default Callable> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId) { + default CompletableFuture> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId) { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -43,9 +43,9 @@ public interface StoreApi { @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) - default Callable>> getInventory() { + default CompletableFuture>> getInventory() { // do some magic! - return () -> new ResponseEntity>(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity>(HttpStatus.OK)); } @@ -57,9 +57,9 @@ public interface StoreApi { @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default Callable> getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { + default CompletableFuture> getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -70,9 +70,9 @@ public interface StoreApi { @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - default Callable> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @RequestBody Order body) { + default CompletableFuture> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @RequestBody Order body) { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java index 8e284d5b8f4..4badb1ac87c 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java @@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; import java.util.List; -import java.util.concurrent.Callable; +import java.util.concurrent.CompletableFuture; @Api(value = "user", description = "the user API") @@ -28,9 +28,9 @@ public interface UserApi { @RequestMapping(value = "/user", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - default Callable> createUser(@ApiParam(value = "Created user object" ,required=true ) @RequestBody User body) { + default CompletableFuture> createUser(@ApiParam(value = "Created user object" ,required=true ) @RequestBody User body) { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -40,9 +40,9 @@ public interface UserApi { @RequestMapping(value = "/user/createWithArray", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - default Callable> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body) { + default CompletableFuture> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body) { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -52,9 +52,9 @@ public interface UserApi { @RequestMapping(value = "/user/createWithList", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - default Callable> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body) { + default CompletableFuture> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body) { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -65,9 +65,9 @@ public interface UserApi { @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - default Callable> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username) { + default CompletableFuture> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username) { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -79,9 +79,9 @@ public interface UserApi { @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default Callable> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username) { + default CompletableFuture> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username) { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -92,10 +92,9 @@ public interface UserApi { @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default Callable> loginUser(@ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { + default CompletableFuture> loginUser(@ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username,@ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -105,9 +104,9 @@ public interface UserApi { @RequestMapping(value = "/user/logout", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default Callable> logoutUser() { + default CompletableFuture> logoutUser() { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } @@ -118,10 +117,9 @@ public interface UserApi { @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.PUT) - default Callable> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body) { + default CompletableFuture> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body) { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } }