diff --git a/modules/swagger-codegen/src/main/resources/JavaSpringMVC/api.mustache b/modules/swagger-codegen/src/main/resources/JavaSpringMVC/api.mustache
index a882c006975..7560d5c0830 100644
--- a/modules/swagger-codegen/src/main/resources/JavaSpringMVC/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/JavaSpringMVC/api.mustache
@@ -8,7 +8,6 @@ import {{modelPackage}}.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.Authorization;
import io.swagger.annotations.AuthorizationScope;
@@ -44,8 +43,8 @@ public class {{classname}} {
}{{/isOAuth}}){{#hasMore}},
{{/hasMore}}{{/authMethods}}
}{{/hasAuthMethods}})
- @ApiResponses(value = { {{#responses}}
- @ApiResponse(code = {{{code}}}, message = "{{{message}}}"){{#hasMore}},{{/hasMore}}{{/responses}} })
+ @io.swagger.annotations.ApiResponses(value = { {{#responses}}
+ @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}"){{#hasMore}},{{/hasMore}}{{/responses}} })
@RequestMapping(value = "{{path}}",
{{#hasProduces}}produces = { {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}
{{#hasConsumes}}consumes = { {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}
diff --git a/modules/swagger-codegen/src/main/resources/JavaSpringMVC/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaSpringMVC/pom.mustache
index c4a71c199ce..60933fa47f3 100644
--- a/modules/swagger-codegen/src/main/resources/JavaSpringMVC/pom.mustache
+++ b/modules/swagger-codegen/src/main/resources/JavaSpringMVC/pom.mustache
@@ -75,31 +75,6 @@
slf4j-log4j12
${slf4j-version}
-
- com.sun.jersey
- jersey-core
- ${jersey-version}
-
-
- com.sun.jersey
- jersey-json
- ${jersey-version}
-
-
- com.sun.jersey
- jersey-servlet
- ${jersey-version}
-
-
- com.sun.jersey.contribs
- jersey-multipart
- ${jersey-version}
-
-
- com.sun.jersey
- jersey-server
- ${jersey-version}
-
@@ -142,22 +117,14 @@
${servlet-api-version}
-
-
- jcenter-snapshots
- jcenter
- http://oss.jfrog.org/artifactory/oss-snapshot-local/
-
-
- 1.5.4
+ 1.5.6
9.2.9.v20150224
1.13
1.6.3
- 1.6.1
4.8.1
2.5
- 2.0.4-SNAPSHOT
- 4.0.9.RELEASE
+ 2.3.1
+ 4.1.8.RELEASE
\ No newline at end of file
diff --git a/samples/server/petstore/spring-mvc/pom.xml b/samples/server/petstore/spring-mvc/pom.xml
index 994b717dcfb..9d4cd5dba17 100644
--- a/samples/server/petstore/spring-mvc/pom.xml
+++ b/samples/server/petstore/spring-mvc/pom.xml
@@ -75,31 +75,6 @@
slf4j-log4j12
${slf4j-version}
-
- com.sun.jersey
- jersey-core
- ${jersey-version}
-
-
- com.sun.jersey
- jersey-json
- ${jersey-version}
-
-
- com.sun.jersey
- jersey-servlet
- ${jersey-version}
-
-
- com.sun.jersey.contribs
- jersey-multipart
- ${jersey-version}
-
-
- com.sun.jersey
- jersey-server
- ${jersey-version}
-
@@ -142,22 +117,14 @@
${servlet-api-version}
-
-
- jcenter-snapshots
- jcenter
- http://oss.jfrog.org/artifactory/oss-snapshot-local/
-
-
- 1.5.4
+ 1.5.6
9.2.9.v20150224
1.13
1.6.3
- 1.6.1
4.8.1
2.5
- 2.0.4-SNAPSHOT
- 4.0.9.RELEASE
+ 2.3.1
+ 4.1.8.RELEASE
\ No newline at end of file
diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/ApiException.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/ApiException.java
index a6d35c09ac2..7bb9e646046 100644
--- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/ApiException.java
+++ b/samples/server/petstore/spring-mvc/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-01-19T23:33:00.911+08:00")
+@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-01-22T15:27:38.634-06:00")
public class ApiException extends Exception{
private int code;
public ApiException (int code, String msg) {
diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/ApiOriginFilter.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/ApiOriginFilter.java
index f76631e5b3e..91a4f0c80de 100644
--- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/ApiOriginFilter.java
+++ b/samples/server/petstore/spring-mvc/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-01-19T23:33:00.911+08:00")
+@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-01-22T15:27:38.634-06:00")
public class ApiOriginFilter implements javax.servlet.Filter {
@Override
public void doFilter(ServletRequest request, ServletResponse response,
diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/ApiResponseMessage.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/ApiResponseMessage.java
index d3b5544f70e..3a9edde1c87 100644
--- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/ApiResponseMessage.java
+++ b/samples/server/petstore/spring-mvc/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-01-19T23:33:00.911+08:00")
+@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-01-22T15:27:38.634-06:00")
public class ApiResponseMessage {
public static final int ERROR = 1;
public static final int WARNING = 2;
diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/NotFoundException.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/NotFoundException.java
index dfd7b6bd2d5..0737abe7fb5 100644
--- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/NotFoundException.java
+++ b/samples/server/petstore/spring-mvc/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-01-19T23:33:00.911+08:00")
+@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-01-22T15:27:38.634-06:00")
public class NotFoundException extends ApiException {
private int code;
public NotFoundException (int code, String msg) {
diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java
index 38cc7aa30a6..20c6cface21 100644
--- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java
+++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java
@@ -4,11 +4,11 @@ import io.swagger.model.*;
import io.swagger.model.Pet;
import java.io.File;
+import io.swagger.model.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.Authorization;
import io.swagger.annotations.AuthorizationScope;
@@ -32,27 +32,22 @@ 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-01-19T23:33:00.911+08:00")
+@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-01-22T15:27:38.634-06:00")
public class PetApi {
- @ApiOperation(value = "Update an existing pet", 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")
- })
- })
- @ApiResponses(value = {
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found"),
- @ApiResponse(code = 405, message = "Validation exception") })
+ @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class)
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied"),
+ @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found"),
+ @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception") })
@RequestMapping(value = "",
- produces = { "application/json", "application/xml" },
+ produces = { "application/xml", "application/json" },
consumes = { "application/json", "application/xml" },
method = RequestMethod.PUT)
public ResponseEntity updatePet(
-@ApiParam(value = "Pet object that needs to be added to the store" ) @RequestBody Pet body
+@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body
)
throws NotFoundException {
// do some magic!
@@ -61,21 +56,16 @@ public class PetApi {
- @ApiOperation(value = "Add a new pet to the store", 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")
- })
- })
- @ApiResponses(value = {
- @ApiResponse(code = 405, message = "Invalid input") })
+ @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class)
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input") })
@RequestMapping(value = "",
- produces = { "application/json", "application/xml" },
+ produces = { "application/xml", "application/json" },
consumes = { "application/json", "application/xml" },
method = RequestMethod.POST)
public ResponseEntity addPet(
-@ApiParam(value = "Pet object that needs to be added to the store" ) @RequestBody Pet body
+@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body
)
throws NotFoundException {
// do some magic!
@@ -84,20 +74,15 @@ public class PetApi {
- @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")
- })
- })
- @ApiResponses(value = {
- @ApiResponse(code = 200, message = "successful operation"),
- @ApiResponse(code = 400, message = "Invalid status value") })
+ @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List")
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation"),
+ @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value") })
@RequestMapping(value = "/findByStatus",
- produces = { "application/json", "application/xml" },
+ produces = { "application/xml", "application/json" },
method = RequestMethod.GET)
- public ResponseEntity> findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", defaultValue = "available") @RequestParam(value = "status", required = false, defaultValue="available") List status
+ public ResponseEntity> findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true) @RequestParam(value = "status", required = true) List status
)
@@ -108,20 +93,15 @@ public class PetApi {
- @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")
- })
- })
- @ApiResponses(value = {
- @ApiResponse(code = 200, message = "successful operation"),
- @ApiResponse(code = 400, message = "Invalid tag value") })
+ @ApiOperation(value = "Finds Pets by tags", notes = "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List")
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation"),
+ @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value") })
@RequestMapping(value = "/findByTags",
- produces = { "application/json", "application/xml" },
+ produces = { "application/xml", "application/json" },
method = RequestMethod.GET)
- public ResponseEntity> findPetsByTags(@ApiParam(value = "Tags to filter by") @RequestParam(value = "tags", required = false) List tags
+ public ResponseEntity> findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags
)
@@ -132,19 +112,19 @@ public class PetApi {
- @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 = {
+ @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = {
@Authorization(value = "api_key")
})
- @ApiResponses(value = {
- @ApiResponse(code = 200, message = "successful operation"),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found") })
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation"),
+ @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied"),
+ @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found") })
@RequestMapping(value = "/{petId}",
- produces = { "application/json", "application/xml" },
+ produces = { "application/xml", "application/json" },
method = RequestMethod.GET)
public ResponseEntity getPetById(
-@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("petId") Long petId
+@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId
)
throws NotFoundException {
@@ -154,20 +134,15 @@ public class PetApi {
- @ApiOperation(value = "Updates a pet in the store with form data", 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")
- })
- })
- @ApiResponses(value = {
- @ApiResponse(code = 405, message = "Invalid input") })
+ @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class)
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input") })
@RequestMapping(value = "/{petId}",
- produces = { "application/json", "application/xml" },
+ produces = { "application/xml", "application/json" },
consumes = { "application/x-www-form-urlencoded" },
method = RequestMethod.POST)
public ResponseEntity updatePetWithForm(
-@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") String petId
+@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId
,
@@ -187,16 +162,12 @@ public class PetApi {
- @ApiOperation(value = "Deletes a pet", 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")
- })
- })
- @ApiResponses(value = {
- @ApiResponse(code = 400, message = "Invalid pet value") })
+ @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class)
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied"),
+ @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found") })
@RequestMapping(value = "/{petId}",
- produces = { "application/json", "application/xml" },
+ produces = { "application/xml", "application/json" },
method = RequestMethod.DELETE)
public ResponseEntity deletePet(
@@ -214,19 +185,14 @@ public class PetApi {
- @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")
- })
- })
- @ApiResponses(value = {
- @ApiResponse(code = 200, message = "successful operation") })
+ @ApiOperation(value = "uploads an image", notes = "", response = ApiResponse.class)
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation") })
@RequestMapping(value = "/{petId}/uploadImage",
- produces = { "application/json", "application/xml" },
+ produces = { "application/json" },
consumes = { "multipart/form-data" },
method = RequestMethod.POST)
- public ResponseEntity uploadFile(
+ public ResponseEntity uploadFile(
@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId
,
@@ -241,29 +207,7 @@ public class PetApi {
)
throws NotFoundException {
// do some magic!
- return new ResponseEntity(HttpStatus.OK);
- }
-
-
-
- @ApiOperation(value = "Fake endpoint to test byte array return by 'Find pet by ID'", notes = "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions", response = byte[].class, authorizations = {
- @Authorization(value = "api_key")
- })
- @ApiResponses(value = {
- @ApiResponse(code = 200, message = "successful operation"),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found") })
- @RequestMapping(value = "/{petId}?testing_byte_array=true",
- produces = { "application/json", "application/xml" },
-
- method = RequestMethod.GET)
- public ResponseEntity getPetByIdWithByteArray(
-@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("petId") Long petId
-
-)
- throws NotFoundException {
- // do some magic!
- return new ResponseEntity(HttpStatus.OK);
+ return new ResponseEntity(HttpStatus.OK);
}
diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java
index 75a13dd0aaf..1cf980306f6 100644
--- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java
+++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java
@@ -8,7 +8,6 @@ import io.swagger.model.Order;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.Authorization;
import io.swagger.annotations.AuthorizationScope;
@@ -32,17 +31,17 @@ 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-01-19T23:33:00.911+08:00")
+@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-01-22T15:27:38.634-06:00")
public class StoreApi {
@ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = {
@Authorization(value = "api_key")
})
- @ApiResponses(value = {
- @ApiResponse(code = 200, message = "successful operation") })
+ @io.swagger.annotations.ApiResponses(value = {
+ @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation") })
@RequestMapping(value = "/inventory",
- produces = { "application/json", "application/xml" },
+ produces = { "application/json" },
method = RequestMethod.GET)
public ResponseEntity