From 31f5675e72d02c07aaee91fd5cdb594670f074c7 Mon Sep 17 00:00:00 2001 From: diyfr Date: Thu, 28 Apr 2016 10:37:55 +0200 Subject: [PATCH] Create windows script for spring-mvc-petstore-j8-async-server sample --- .../spring-mvc-petstore-j8-async-server.bat | 10 ++++ .../java/io/swagger/api/ApiException.java | 2 +- .../java/io/swagger/api/ApiOriginFilter.java | 2 +- .../io/swagger/api/ApiResponseMessage.java | 2 +- .../io/swagger/api/NotFoundException.java | 2 +- .../src/main/java/io/swagger/api/PetApi.java | 47 ++++++++++--------- .../main/java/io/swagger/api/StoreApi.java | 14 +++--- .../src/main/java/io/swagger/api/UserApi.java | 30 ++++++------ .../swagger/configuration/SwaggerConfig.java | 23 ++++----- .../configuration/SwaggerUiConfiguration.java | 2 +- .../swagger/configuration/WebApplication.java | 2 +- .../configuration/WebMvcConfiguration.java | 2 +- .../main/java/io/swagger/model/Category.java | 2 +- .../src/main/java/io/swagger/model/Order.java | 4 +- .../src/main/java/io/swagger/model/Pet.java | 2 +- .../src/main/java/io/swagger/model/Tag.java | 2 +- .../src/main/java/io/swagger/model/User.java | 2 +- 17 files changed, 82 insertions(+), 68 deletions(-) create mode 100644 bin/windows/spring-mvc-petstore-j8-async-server.bat diff --git a/bin/windows/spring-mvc-petstore-j8-async-server.bat b/bin/windows/spring-mvc-petstore-j8-async-server.bat new file mode 100644 index 00000000000..601de1ff6f8 --- /dev/null +++ b/bin/windows/spring-mvc-petstore-j8-async-server.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +set JAVA_OPTS=%JAVA_OPTS% -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties +set ags=generate -t modules\swagger-codegen\src\main\resources\JavaSpringMVC -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l spring-mvc -o samples/server/petstore/spring-mvc-j8-async -c bin/spring-mvc-petstore-j8-async.json + +java %JAVA_OPTS% -jar %executable% %ags% \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/ApiException.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/ApiException.java index 20930979750..eed42860459 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/ApiException.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/ApiException.java @@ -1,6 +1,6 @@ package io.swagger.api; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-28T10:36:54.900+02:00") public class ApiException extends Exception{ private int code; public ApiException (int code, String msg) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/ApiOriginFilter.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/ApiOriginFilter.java index c8a46b8ac99..99e1b55b6a5 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/ApiOriginFilter.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/ApiOriginFilter.java @@ -5,7 +5,7 @@ import java.io.IOException; import javax.servlet.*; import javax.servlet.http.HttpServletResponse; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-28T10:36:54.900+02:00") public class ApiOriginFilter implements javax.servlet.Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/ApiResponseMessage.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/ApiResponseMessage.java index 91b3d9d6d36..1ce56229af2 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/ApiResponseMessage.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/ApiResponseMessage.java @@ -3,7 +3,7 @@ package io.swagger.api; import javax.xml.bind.annotation.XmlTransient; @javax.xml.bind.annotation.XmlRootElement -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-28T10:36:54.900+02:00") public class ApiResponseMessage { public static final int ERROR = 1; public static final int WARNING = 2; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/NotFoundException.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/NotFoundException.java index 40471f4716f..25a24d69b49 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/NotFoundException.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/NotFoundException.java @@ -1,6 +1,6 @@ package io.swagger.api; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-28T10:36:54.900+02:00") public class NotFoundException extends ApiException { private int code; public NotFoundException (int code, String msg) { 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 df8a67686b6..20370877b4d 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 @@ -3,7 +3,6 @@ package io.swagger.api; import io.swagger.model.*; import io.swagger.model.Pet; -import io.swagger.model.ApiResponse; import java.io.File; import java.util.concurrent.Callable; @@ -35,7 +34,7 @@ import static org.springframework.http.MediaType.*; @Controller @RequestMapping(value = "/pet", produces = {APPLICATION_JSON_VALUE}) @Api(value = "/pet", description = "the pet API") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-28T10:36:54.900+02:00") public interface PetApi { @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { @@ -47,12 +46,12 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping(value = "", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, 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 +@ApiParam(value = "Pet object that needs to be added to the store" ) @RequestBody Pet body ) throws NotFoundException { // do some magic! @@ -69,7 +68,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping(value = "/{petId}", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, method = RequestMethod.DELETE) default Callable> deletePet( @@ -86,7 +85,7 @@ public interface PetApi { } - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma seperated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -96,10 +95,10 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping(value = "/findByStatus", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, 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 Callable>> findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", defaultValue = "available") @RequestParam(value = "status", required = false, defaultValue="available") List status ) @@ -109,7 +108,7 @@ public interface PetApi { } - @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", notes = "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -119,10 +118,10 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping(value = "/findByTags", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, method = RequestMethod.GET) - default Callable>> findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags + default Callable>> findPetsByTags(@ApiParam(value = "Tags to filter by") @RequestParam(value = "tags", required = false) List tags ) @@ -132,7 +131,11 @@ public interface PetApi { } - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @ApiOperation(value = "Find pet by ID", notes = "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions", response = Pet.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }), @Authorization(value = "api_key") }) @ApiResponses(value = { @@ -140,11 +143,11 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) @RequestMapping(value = "/{petId}", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, method = RequestMethod.GET) default Callable> getPetById( -@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId +@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("petId") Long petId ) throws NotFoundException { @@ -164,12 +167,12 @@ public interface PetApi { @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) @RequestMapping(value = "", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, 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 +@ApiParam(value = "Pet object that needs to be added to the store" ) @RequestBody Pet body ) throws NotFoundException { // do some magic! @@ -186,11 +189,11 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping(value = "/{petId}", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, 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 = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") String petId , @@ -209,7 +212,7 @@ public interface PetApi { } - @ApiOperation(value = "uploads an image", notes = "", response = ApiResponse.class, authorizations = { + @ApiOperation(value = "uploads an image", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -218,10 +221,10 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/{petId}/uploadImage", - produces = { "application/json" }, + produces = { "application/json", "application/xml" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default Callable> uploadFile( + default Callable> uploadFile( @ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId , @@ -236,7 +239,7 @@ public interface PetApi { ) throws NotFoundException { // do some magic! - return () -> new ResponseEntity(HttpStatus.OK); + return () -> 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 5063976abb9..bcb1fa75fdf 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 @@ -34,7 +34,7 @@ import static org.springframework.http.MediaType.*; @Controller @RequestMapping(value = "/store", produces = {APPLICATION_JSON_VALUE}) @Api(value = "/store", description = "the store API") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-28T10:36:54.900+02:00") public interface StoreApi { @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class) @@ -42,7 +42,7 @@ public interface StoreApi { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping(value = "/order/{orderId}", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, method = RequestMethod.DELETE) default Callable> deleteOrder( @@ -61,7 +61,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/inventory", - produces = { "application/json" }, + produces = { "application/json", "application/xml" }, method = RequestMethod.GET) default Callable>> getInventory() @@ -77,11 +77,11 @@ public interface StoreApi { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping(value = "/order/{orderId}", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, method = RequestMethod.GET) default Callable> getOrderById( -@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId +@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") String orderId ) throws NotFoundException { @@ -95,12 +95,12 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping(value = "/order", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, method = RequestMethod.POST) default Callable> placeOrder( -@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @RequestBody Order body +@ApiParam(value = "order placed for purchasing the pet" ) @RequestBody Order body ) throws NotFoundException { // do some magic! 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 73c8893c5cf..299d87787f7 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 @@ -34,19 +34,19 @@ import static org.springframework.http.MediaType.*; @Controller @RequestMapping(value = "/user", produces = {APPLICATION_JSON_VALUE}) @Api(value = "/user", description = "the user API") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-28T10:36:54.900+02:00") public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, method = RequestMethod.POST) default Callable> createUser( -@ApiParam(value = "Created user object" ,required=true ) @RequestBody User body +@ApiParam(value = "Created user object" ) @RequestBody User body ) throws NotFoundException { // do some magic! @@ -58,12 +58,12 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/createWithArray", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, method = RequestMethod.POST) default Callable> createUsersWithArrayInput( -@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body +@ApiParam(value = "List of user object" ) @RequestBody List body ) throws NotFoundException { // do some magic! @@ -75,12 +75,12 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/createWithList", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, method = RequestMethod.POST) default Callable> createUsersWithListInput( -@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body +@ApiParam(value = "List of user object" ) @RequestBody List body ) throws NotFoundException { // do some magic! @@ -93,7 +93,7 @@ public interface UserApi { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @RequestMapping(value = "/{username}", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, method = RequestMethod.DELETE) default Callable> deleteUser( @@ -112,7 +112,7 @@ public interface UserApi { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @RequestMapping(value = "/{username}", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, method = RequestMethod.GET) default Callable> getUserByName( @@ -130,14 +130,14 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping(value = "/login", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, method = RequestMethod.GET) - default Callable> loginUser(@ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username + default Callable> loginUser(@ApiParam(value = "The user name for login") @RequestParam(value = "username", required = false) String username , - @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password + @ApiParam(value = "The password for login in clear text") @RequestParam(value = "password", required = false) String password ) @@ -151,7 +151,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/logout", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, method = RequestMethod.GET) default Callable> logoutUser() @@ -166,7 +166,7 @@ public interface UserApi { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) @RequestMapping(value = "/{username}", - produces = { "application/xml", "application/json" }, + produces = { "application/json", "application/xml" }, method = RequestMethod.PUT) default Callable> updateUser( @@ -175,7 +175,7 @@ public interface UserApi { , -@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body +@ApiParam(value = "Updated user object" ) @RequestBody User body ) throws NotFoundException { // do some magic! diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/SwaggerConfig.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/SwaggerConfig.java index 9573f7880f8..0fdecba76ae 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/SwaggerConfig.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/SwaggerConfig.java @@ -7,6 +7,7 @@ import org.springframework.context.annotation.PropertySource; import org.springframework.context.annotation.Import; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; @@ -18,19 +19,19 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; @EnableSwagger2 //Loads the spring beans required by the framework @PropertySource("classpath:swagger.properties") @Import(SwaggerUiConfiguration.class) -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-28T10:36:54.900+02:00") public class SwaggerConfig { @Bean ApiInfo apiInfo() { - ApiInfo apiInfo = new ApiInfo( - "Swagger Petstore", - "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", - "1.0.0", - "", - "apiteam@swagger.io", - "Apache 2.0", - "http://www.apache.org/licenses/LICENSE-2.0.html" ); - return apiInfo; + return new ApiInfoBuilder() + .title("Swagger Petstore") + .description("This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters") + .license("Apache 2.0") + .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") + .termsOfServiceUrl("") + .version("1.0.0") + .contact(new Contact("","", "apiteam@wordnik.com")) + .build(); } @Bean @@ -38,4 +39,4 @@ public class SwaggerConfig { return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/SwaggerUiConfiguration.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/SwaggerUiConfiguration.java index 7673f5afbcb..3aced576dd6 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/SwaggerUiConfiguration.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/SwaggerUiConfiguration.java @@ -8,7 +8,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter @Configuration @EnableWebMvc -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-28T10:36:54.900+02:00") public class SwaggerUiConfiguration extends WebMvcConfigurerAdapter { private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" }; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/WebApplication.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/WebApplication.java index f8658aaaa29..20493a360b7 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/WebApplication.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/WebApplication.java @@ -2,7 +2,7 @@ package io.swagger.configuration; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-28T10:36:54.900+02:00") public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer { @Override diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/WebMvcConfiguration.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/WebMvcConfiguration.java index aab4bf2e7d1..18b4303d983 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/WebMvcConfiguration.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/WebMvcConfiguration.java @@ -3,7 +3,7 @@ package io.swagger.configuration; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-28T10:36:54.900+02:00") public class WebMvcConfiguration extends WebMvcConfigurationSupport { @Override public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Category.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Category.java index f4690dd7900..beb9b8c217c 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Category.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Category.java @@ -10,7 +10,7 @@ import java.util.Objects; @ApiModel(description = "") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-28T10:36:54.900+02:00") public class Category { private Long id = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Order.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Order.java index 8b5355db47f..6ae758200d8 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Order.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Order.java @@ -11,7 +11,7 @@ import java.util.Objects; @ApiModel(description = "") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-28T10:36:54.900+02:00") public class Order { private Long id = null; @@ -23,7 +23,7 @@ public class Order { }; private StatusEnum status = null; - private Boolean complete = false; + private Boolean complete = null; /** **/ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java index e767e6f079c..6154d4e5b8f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java @@ -14,7 +14,7 @@ import java.util.Objects; @ApiModel(description = "") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-28T10:36:54.900+02:00") public class Pet { private Long id = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Tag.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Tag.java index 9b7bd88ad3c..f927f607be2 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Tag.java @@ -10,7 +10,7 @@ import java.util.Objects; @ApiModel(description = "") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-28T10:36:54.900+02:00") public class Tag { private Long id = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/User.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/User.java index f05fe4b6099..55661ec8c7d 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/User.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/User.java @@ -10,7 +10,7 @@ import java.util.Objects; @ApiModel(description = "") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-28T10:36:54.900+02:00") public class User { private Long id = null;