diff --git a/modules/swagger-codegen/src/main/resources/JavaSpringMVC/model.mustache b/modules/swagger-codegen/src/main/resources/JavaSpringMVC/model.mustache
index d1a5e396e13..b39a599ae71 100644
--- a/modules/swagger-codegen/src/main/resources/JavaSpringMVC/model.mustache
+++ b/modules/swagger-codegen/src/main/resources/JavaSpringMVC/model.mustache
@@ -20,8 +20,12 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
public enum {{datatypeWithEnum}} {
{{#allowableValues}}{{#values}} {{.}}, {{/values}}{{/allowableValues}}
};
- private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/isEnum}}{{^isEnum}}
- private {{{datatype}}} {{name}} = {{{defaultValue}}};{{/isEnum}}{{/vars}}
+ {{/isEnum}}{{#items}}{{#isEnum}}
+ public enum {{datatypeWithEnum}} {
+ {{#allowableValues}}{{#values}} {{.}}, {{/values}}{{/allowableValues}}
+ };
+ {{/isEnum}}{{/items}}
+ private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/vars}}
{{#vars}}
/**{{#description}}
diff --git a/samples/server/petstore/spring-mvc-j8-async/README.md b/samples/server/petstore/spring-mvc-j8-async/README.md
new file mode 100644
index 00000000000..c98ef6ecff7
--- /dev/null
+++ b/samples/server/petstore/spring-mvc-j8-async/README.md
@@ -0,0 +1,12 @@
+# Swagger generated server
+
+Spring MVC Server
+
+
+## Overview
+This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [OpenAPI-Spec](https://github.com/swagger-api/swagger-core), you can easily generate a server stub. This is an example of building a swagger-enabled server in Java using the Spring MVC framework.
+
+The underlying library integrating swagger to Spring-MVC is [springfox](https://github.com/springfox/springfox)
+
+You can view the server in swagger-ui by pointing to
+http://localhost:8002/v2/swagger-ui.html
\ No newline at end of file
diff --git a/samples/server/petstore/spring-mvc-j8-async/pom.xml b/samples/server/petstore/spring-mvc-j8-async/pom.xml
new file mode 100644
index 00000000000..cc78851ae30
--- /dev/null
+++ b/samples/server/petstore/spring-mvc-j8-async/pom.xml
@@ -0,0 +1,172 @@
+
+ 4.0.0
+ io.swagger
+ swagger-spring-mvc-server
+ jar
+ swagger-spring-mvc-server
+ 1.0.0
+
+ src/main/java
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+ 2.1.1
+
+
+ maven-failsafe-plugin
+ 2.6
+
+
+
+ integration-test
+ verify
+
+
+
+
+
+ org.eclipse.jetty
+ jetty-maven-plugin
+ ${jetty-version}
+
+
+ /v2
+
+ target/${project.artifactId}-${project.version}
+ 8079
+ stopit
+
+ 8002
+ 60000
+
+
+
+
+ start-jetty
+ pre-integration-test
+
+ start
+
+
+ 0
+ true
+
+
+
+ stop-jetty
+ post-integration-test
+
+ stop
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.3
+
+ 1.8
+ 1.8
+
+
+
+
+
+
+ io.swagger
+ swagger-jersey-jaxrs
+ ${swagger-core-version}
+
+
+ org.slf4j
+ 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}
+
+
+
+
+ org.springframework
+ spring-core
+ ${spring-version}
+
+
+ org.springframework
+ spring-webmvc
+ ${spring-version}
+
+
+ org.springframework
+ spring-web
+ ${spring-version}
+
+
+
+
+ io.springfox
+ springfox-swagger2
+ ${springfox-version}
+
+
+ io.springfox
+ springfox-swagger-ui
+ ${springfox-version}
+
+
+
+ junit
+ junit
+ ${junit-version}
+ test
+
+
+ javax.servlet
+ servlet-api
+ ${servlet-api-version}
+
+
+
+
+ jcenter-snapshots
+ jcenter
+ http://oss.jfrog.org/artifactory/oss-snapshot-local/
+
+
+
+ 1.5.7
+ 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
+
+
\ 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
new file mode 100644
index 00000000000..5cba2d3db86
--- /dev/null
+++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/ApiException.java
@@ -0,0 +1,10 @@
+package io.swagger.api;
+
+@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-02-26T13:59:02.543Z")
+public class ApiException extends Exception{
+ private int code;
+ public ApiException (int code, String msg) {
+ super(msg);
+ this.code = code;
+ }
+}
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
new file mode 100644
index 00000000000..81dbc940508
--- /dev/null
+++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/ApiOriginFilter.java
@@ -0,0 +1,27 @@
+package io.swagger.api;
+
+import java.io.IOException;
+
+import javax.servlet.*;
+import javax.servlet.http.HttpServletResponse;
+
+@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-02-26T13:59:02.543Z")
+public class ApiOriginFilter implements javax.servlet.Filter {
+ @Override
+ public void doFilter(ServletRequest request, ServletResponse response,
+ FilterChain chain) throws IOException, ServletException {
+ HttpServletResponse res = (HttpServletResponse) response;
+ res.addHeader("Access-Control-Allow-Origin", "*");
+ res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
+ res.addHeader("Access-Control-Allow-Headers", "Content-Type");
+ chain.doFilter(request, response);
+ }
+
+ @Override
+ public void destroy() {
+ }
+
+ @Override
+ public void init(FilterConfig filterConfig) throws ServletException {
+ }
+}
\ No newline at end of file
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
new file mode 100644
index 00000000000..51d9bb1e2d0
--- /dev/null
+++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/ApiResponseMessage.java
@@ -0,0 +1,69 @@
+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-02-26T13:59:02.543Z")
+public class ApiResponseMessage {
+ public static final int ERROR = 1;
+ public static final int WARNING = 2;
+ public static final int INFO = 3;
+ public static final int OK = 4;
+ public static final int TOO_BUSY = 5;
+
+ int code;
+ String type;
+ String message;
+
+ public ApiResponseMessage(){}
+
+ public ApiResponseMessage(int code, String message){
+ this.code = code;
+ switch(code){
+ case ERROR:
+ setType("error");
+ break;
+ case WARNING:
+ setType("warning");
+ break;
+ case INFO:
+ setType("info");
+ break;
+ case OK:
+ setType("ok");
+ break;
+ case TOO_BUSY:
+ setType("too busy");
+ break;
+ default:
+ setType("unknown");
+ break;
+ }
+ this.message = message;
+ }
+
+ @XmlTransient
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+}
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
new file mode 100644
index 00000000000..0e298e5c443
--- /dev/null
+++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/NotFoundException.java
@@ -0,0 +1,10 @@
+package io.swagger.api;
+
+@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-02-26T13:59:02.543Z")
+public class NotFoundException extends ApiException {
+ private int code;
+ public NotFoundException (int code, String msg) {
+ super(code, msg);
+ this.code = code;
+ }
+}
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
new file mode 100644
index 00000000000..ff793304ac5
--- /dev/null
+++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java
@@ -0,0 +1,280 @@
+package io.swagger.api;
+
+import io.swagger.model.*;
+
+import io.swagger.model.Pet;
+import java.io.File;
+
+import java.util.concurrent.Callable;
+
+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;
+
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RequestPart;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+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-02-26T13:59:02.543Z")
+public interface 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") })
+ @RequestMapping(value = "",
+ 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" ) @RequestBody Pet body
+)
+ throws NotFoundException {
+ // do some magic!
+ return () -> new ResponseEntity(HttpStatus.OK);
+ }
+
+
+
+ @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") })
+ @RequestMapping(value = "",
+ 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" ) @RequestBody Pet body
+)
+ throws NotFoundException {
+ // do some magic!
+ return () -> new ResponseEntity(HttpStatus.OK);
+ }
+
+
+
+ @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") })
+ @RequestMapping(value = "/findByStatus",
+ produces = { "application/json", "application/xml" },
+
+ method = RequestMethod.GET)
+ 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
+
+
+)
+ throws NotFoundException {
+ // do some magic!
+ return () -> new ResponseEntity>(HttpStatus.OK);
+ }
+
+
+
+ @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") })
+ @RequestMapping(value = "/findByTags",
+ produces = { "application/json", "application/xml" },
+
+ method = RequestMethod.GET)
+ default Callable>> findPetsByTags(@ApiParam(value = "Tags to filter by") @RequestParam(value = "tags", required = false) List tags
+
+
+)
+ throws NotFoundException {
+ // do some magic!
+ return () -> new ResponseEntity>(HttpStatus.OK);
+ }
+
+
+
+ @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 = {
+ @ApiResponse(code = 200, message = "successful operation"),
+ @ApiResponse(code = 400, message = "Invalid ID supplied"),
+ @ApiResponse(code = 404, message = "Pet not found") })
+ @RequestMapping(value = "/{petId}",
+ produces = { "application/json", "application/xml" },
+
+ method = RequestMethod.GET)
+ default Callable> getPetById(
+@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);
+ }
+
+
+
+ @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") })
+ @RequestMapping(value = "/{petId}",
+ 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") String 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
+)
+ throws NotFoundException {
+ // do some magic!
+ return () -> new ResponseEntity(HttpStatus.OK);
+ }
+
+
+
+ @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") })
+ @RequestMapping(value = "/{petId}",
+ produces = { "application/json", "application/xml" },
+
+ method = RequestMethod.DELETE)
+ default Callable> deletePet(
+@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId
+
+,
+
+@ApiParam(value = "" ) @RequestHeader(value="apiKey", required=false) String apiKey
+
+)
+ throws NotFoundException {
+ // do some magic!
+ return () -> new ResponseEntity(HttpStatus.OK);
+ }
+
+
+
+ @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") })
+ @RequestMapping(value = "/{petId}/uploadImage",
+ produces = { "application/json", "application/xml" },
+ 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
+)
+ 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 = "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 = {
+ @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)
+ default Callable> petPetIdtestingByteArraytrueGet(
+@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);
+ }
+
+
+}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PettestingByteArraytrueApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PettestingByteArraytrueApi.java
new file mode 100644
index 00000000000..22559ad5c9b
--- /dev/null
+++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PettestingByteArraytrueApi.java
@@ -0,0 +1,61 @@
+package io.swagger.api;
+
+import io.swagger.model.*;
+
+
+import java.util.concurrent.Callable;
+
+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;
+
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RequestPart;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+import static org.springframework.http.MediaType.*;
+
+@Controller
+@RequestMapping(value = "/pet?testing_byte_array=true", produces = {APPLICATION_JSON_VALUE})
+@Api(value = "/pet?testing_byte_array=true", description = "the pet?testing_byte_array=true API")
+@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-02-26T13:59:02.543Z")
+public interface PettestingByteArraytrueApi {
+
+
+ @ApiOperation(value = "Fake endpoint to test byte array in body parameter for adding 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") })
+ @RequestMapping(value = "",
+ produces = { "application/json", "application/xml" },
+ consumes = { "application/json", "application/xml" },
+ method = RequestMethod.POST)
+ default Callable> addPetUsingByteArray(
+
+@ApiParam(value = "Pet object in the form of byte array" ) @RequestBody byte[] body
+)
+ throws NotFoundException {
+ // do some magic!
+ 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
new file mode 100644
index 00000000000..a664cac3c60
--- /dev/null
+++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java
@@ -0,0 +1,121 @@
+package io.swagger.api;
+
+import io.swagger.model.*;
+
+import java.util.Map;
+import io.swagger.model.Order;
+
+import java.util.concurrent.Callable;
+
+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;
+
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RequestPart;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+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-02-26T13:59:02.543Z")
+public interface 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") })
+ @RequestMapping(value = "/inventory",
+ produces = { "application/json", "application/xml" },
+
+ method = RequestMethod.GET)
+ default Callable>> getInventory()
+ throws NotFoundException {
+ // do some magic!
+ return () -> new ResponseEntity