diff --git a/samples/server/petstore/jaxrs/README.md b/samples/server/petstore/jaxrs/README.md index 00431f63dbc..ee5dba41872 100644 --- a/samples/server/petstore/jaxrs/README.md +++ b/samples/server/petstore/jaxrs/README.md @@ -12,3 +12,12 @@ To run the server, please execute the following: ``` mvn clean package jetty:run ``` + +You can then view the swagger listing here: + +``` +http://localhost:8080/v2/swagger.json +``` + +Note that if you have configured the `host` to be something other than localhost, the calls through +swagger-ui will be directed to that host and not localhost! \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/ApiException.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/ApiException.java index 765ae959367..8774e105037 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/ApiException.java +++ b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/ApiException.java @@ -1,6 +1,6 @@ package io.swagger.api; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-12-01T23:19:25.707+08:00") public class ApiException extends Exception{ private int code; public ApiException (int code, String msg) { diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/ApiOriginFilter.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/ApiOriginFilter.java index 9559bd394aa..73d2a09bfe0 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/ApiOriginFilter.java +++ b/samples/server/petstore/jaxrs/src/gen/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.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-12-01T23:19:25.707+08:00") public class ApiOriginFilter implements javax.servlet.Filter { public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/ApiResponseMessage.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/ApiResponseMessage.java index 2460847cf6a..f8158c15640 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/ApiResponseMessage.java +++ b/samples/server/petstore/jaxrs/src/gen/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.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-12-01T23:19:25.707+08:00") public class ApiResponseMessage { public static final int ERROR = 1; public static final int WARNING = 2; diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/NotFoundException.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/NotFoundException.java index 58dc8bcd1ad..10bdc6f8b88 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/NotFoundException.java +++ b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/NotFoundException.java @@ -1,6 +1,6 @@ package io.swagger.api; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-12-01T23:19:25.707+08:00") public class NotFoundException extends ApiException { private int code; public NotFoundException (int code, String msg) { diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/PetApi.java index e8db743f900..37f781ba983 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/PetApi.java @@ -19,14 +19,16 @@ import java.io.InputStream; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; +import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; @Path("/pet") @io.swagger.annotations.Api(description = "the pet API") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-12-01T23:19:25.707+08:00") public class PetApi { private final PetApiService delegate = PetApiServiceFactory.getPetApi(); @@ -47,9 +49,9 @@ public class PetApi { @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ) Pet body) + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ) Pet body,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.updatePet(body); + return delegate.updatePet(body,securityContext); } @POST @@ -64,9 +66,9 @@ public class PetApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ) Pet body) + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ) Pet body,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.addPet(body); + return delegate.addPet(body,securityContext); } @GET @Path("/findByStatus") @@ -83,9 +85,9 @@ public class PetApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) - public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", defaultValue="available") @QueryParam("status") List status) + public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", defaultValue="available") @QueryParam("status") List status,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.findPetsByStatus(status); + return delegate.findPetsByStatus(status,securityContext); } @GET @Path("/findByTags") @@ -102,9 +104,9 @@ public class PetApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) - public Response findPetsByTags(@ApiParam(value = "Tags to filter by") @QueryParam("tags") List tags) + public Response findPetsByTags(@ApiParam(value = "Tags to filter by") @QueryParam("tags") List tags,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.findPetsByTags(tags); + return delegate.findPetsByTags(tags,securityContext); } @GET @Path("/{petId}") @@ -120,9 +122,9 @@ public class PetApi { @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) - public Response getPetById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("petId") Long petId) + public Response getPetById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("petId") Long petId,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.getPetById(petId); + return delegate.getPetById(petId,securityContext); } @POST @Path("/{petId}") @@ -137,11 +139,9 @@ public class PetApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") String petId, - @ApiParam(value = "Updated name of the pet")@FormParam("name") String name, - @ApiParam(value = "Updated status of the pet")@FormParam("status") String status) + public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") String petId,@ApiParam(value = "Updated name of the pet")@FormParam("name") String name,@ApiParam(value = "Updated status of the pet")@FormParam("status") String status,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.updatePetWithForm(petId,name,status); + return delegate.updatePetWithForm(petId,name,status,securityContext); } @DELETE @Path("/{petId}") @@ -156,10 +156,9 @@ public class PetApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId, - @ApiParam(value = "" )@HeaderParam("api_key") String apiKey) + public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.deletePet(petId,apiKey); + return delegate.deletePet(petId,apiKey,securityContext); } @POST @Path("/{petId}/uploadImage") @@ -174,12 +173,9 @@ public class PetApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId, - @ApiParam(value = "Additional data to pass to server")@FormParam("additionalMetadata") String additionalMetadata, - @FormDataParam("file") InputStream inputStream, - @FormDataParam("file") FormDataContentDisposition fileDetail) + public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId,@ApiParam(value = "Additional data to pass to server")@FormParam("additionalMetadata") String additionalMetadata, @FormDataParam("file") InputStream inputStream, + @FormDataParam("file") FormDataContentDisposition fileDetail,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.uploadFile(petId,additionalMetadata,fileDetail); + return delegate.uploadFile(petId,additionalMetadata,fileDetail,securityContext); } } - diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/PetApiService.java index b7e1ead74cc..fa43b1f51fb 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/PetApiService.java @@ -17,32 +17,33 @@ import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-12-01T23:19:25.707+08:00") public abstract class PetApiService { - public abstract Response updatePet(Pet body) + public abstract Response updatePet(Pet body,SecurityContext securityContext) throws NotFoundException; - public abstract Response addPet(Pet body) + public abstract Response addPet(Pet body,SecurityContext securityContext) throws NotFoundException; - public abstract Response findPetsByStatus(List status) + public abstract Response findPetsByStatus(List status,SecurityContext securityContext) throws NotFoundException; - public abstract Response findPetsByTags(List tags) + public abstract Response findPetsByTags(List tags,SecurityContext securityContext) throws NotFoundException; - public abstract Response getPetById(Long petId) + public abstract Response getPetById(Long petId,SecurityContext securityContext) throws NotFoundException; - public abstract Response updatePetWithForm(String petId,String name,String status) + public abstract Response updatePetWithForm(String petId,String name,String status,SecurityContext securityContext) throws NotFoundException; - public abstract Response deletePet(Long petId,String apiKey) + public abstract Response deletePet(Long petId,String apiKey,SecurityContext securityContext) throws NotFoundException; - public abstract Response uploadFile(Long petId,String additionalMetadata,FormDataContentDisposition fileDetail) + public abstract Response uploadFile(Long petId,String additionalMetadata,FormDataContentDisposition fileDetail,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/StoreApi.java index 7c9b500470a..868b1f2c2a8 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/StoreApi.java @@ -19,14 +19,16 @@ import java.io.InputStream; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; +import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; @Path("/store") @io.swagger.annotations.Api(description = "the store API") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-12-01T23:19:25.707+08:00") public class StoreApi { private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi(); @@ -40,9 +42,9 @@ public class StoreApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) - public Response getInventory() + public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { - return delegate.getInventory(); + return delegate.getInventory(securityContext); } @POST @Path("/order") @@ -54,9 +56,9 @@ public class StoreApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) - public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ) Order body) + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ) Order body,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.placeOrder(body); + return delegate.placeOrder(body,securityContext); } @GET @Path("/order/{orderId}") @@ -70,9 +72,9 @@ public class StoreApi { @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) - public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") String orderId) + public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") String orderId,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.getOrderById(orderId); + return delegate.getOrderById(orderId,securityContext); } @DELETE @Path("/order/{orderId}") @@ -84,9 +86,8 @@ public class StoreApi { @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("orderId") String orderId) + public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("orderId") String orderId,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.deleteOrder(orderId); + return delegate.deleteOrder(orderId,securityContext); } } - diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/StoreApiService.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/StoreApiService.java index 721117cf3b3..f90a96d8399 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/StoreApiService.java @@ -17,20 +17,21 @@ import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-12-01T23:19:25.707+08:00") public abstract class StoreApiService { - public abstract Response getInventory() + public abstract Response getInventory(SecurityContext securityContext) throws NotFoundException; - public abstract Response placeOrder(Order body) + public abstract Response placeOrder(Order body,SecurityContext securityContext) throws NotFoundException; - public abstract Response getOrderById(String orderId) + public abstract Response getOrderById(String orderId,SecurityContext securityContext) throws NotFoundException; - public abstract Response deleteOrder(String orderId) + public abstract Response deleteOrder(String orderId,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/UserApi.java index 718fbbe9a9a..4c48e6e3ec6 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/UserApi.java @@ -19,14 +19,16 @@ import java.io.InputStream; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; +import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; @Path("/user") @io.swagger.annotations.Api(description = "the user API") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-12-01T23:19:25.707+08:00") public class UserApi { private final UserApiService delegate = UserApiServiceFactory.getUserApi(); @@ -38,9 +40,9 @@ public class UserApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUser(@ApiParam(value = "Created user object" ) User body) + public Response createUser(@ApiParam(value = "Created user object" ) User body,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.createUser(body); + return delegate.createUser(body,securityContext); } @POST @Path("/createWithArray") @@ -50,9 +52,9 @@ public class UserApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ) List body) + public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ) List body,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.createUsersWithArrayInput(body); + return delegate.createUsersWithArrayInput(body,securityContext); } @POST @Path("/createWithList") @@ -62,9 +64,9 @@ public class UserApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUsersWithListInput(@ApiParam(value = "List of user object" ) List body) + public Response createUsersWithListInput(@ApiParam(value = "List of user object" ) List body,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.createUsersWithListInput(body); + return delegate.createUsersWithListInput(body,securityContext); } @GET @Path("/login") @@ -76,10 +78,9 @@ public class UserApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) - public Response loginUser(@ApiParam(value = "The user name for login") @QueryParam("username") String username, - @ApiParam(value = "The password for login in clear text") @QueryParam("password") String password) + public Response loginUser(@ApiParam(value = "The user name for login") @QueryParam("username") String username,@ApiParam(value = "The password for login in clear text") @QueryParam("password") String password,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.loginUser(username,password); + return delegate.loginUser(username,password,securityContext); } @GET @Path("/logout") @@ -89,9 +90,9 @@ public class UserApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response logoutUser() + public Response logoutUser(@Context SecurityContext securityContext) throws NotFoundException { - return delegate.logoutUser(); + return delegate.logoutUser(securityContext); } @GET @Path("/{username}") @@ -105,9 +106,9 @@ public class UserApi { @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) - public Response getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathParam("username") String username) + public Response getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathParam("username") String username,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.getUserByName(username); + return delegate.getUserByName(username,securityContext); } @PUT @Path("/{username}") @@ -119,10 +120,9 @@ public class UserApi { @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username, - @ApiParam(value = "Updated user object" ) User body) + public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username,@ApiParam(value = "Updated user object" ) User body,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.updateUser(username,body); + return delegate.updateUser(username,body,securityContext); } @DELETE @Path("/{username}") @@ -134,9 +134,8 @@ public class UserApi { @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathParam("username") String username) + public Response deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathParam("username") String username,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.deleteUser(username); + return delegate.deleteUser(username,securityContext); } } - diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/UserApiService.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/UserApiService.java index aebc957e25c..c9f1fef2fb8 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/UserApiService.java +++ b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/UserApiService.java @@ -17,32 +17,33 @@ import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-12-01T23:19:25.707+08:00") public abstract class UserApiService { - public abstract Response createUser(User body) + public abstract Response createUser(User body,SecurityContext securityContext) throws NotFoundException; - public abstract Response createUsersWithArrayInput(List body) + public abstract Response createUsersWithArrayInput(List body,SecurityContext securityContext) throws NotFoundException; - public abstract Response createUsersWithListInput(List body) + public abstract Response createUsersWithListInput(List body,SecurityContext securityContext) throws NotFoundException; - public abstract Response loginUser(String username,String password) + public abstract Response loginUser(String username,String password,SecurityContext securityContext) throws NotFoundException; - public abstract Response logoutUser() + public abstract Response logoutUser(SecurityContext securityContext) throws NotFoundException; - public abstract Response getUserByName(String username) + public abstract Response getUserByName(String username,SecurityContext securityContext) throws NotFoundException; - public abstract Response updateUser(String username,User body) + public abstract Response updateUser(String username,User body,SecurityContext securityContext) throws NotFoundException; - public abstract Response deleteUser(String username) + public abstract Response deleteUser(String username,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Category.java index 5db3559b5b6..8c97caf5663 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Category.java @@ -8,7 +8,7 @@ import java.util.Objects; @ApiModel(description = "") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-24T12:32:47.191+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-12-01T23:19:25.707+08:00") public class Category { private Long id = null; diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Order.java index 6c70f9086a0..fd7e7a4e7fd 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Order.java @@ -9,7 +9,7 @@ import java.util.Objects; @ApiModel(description = "") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-24T12:32:47.191+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-12-01T23:19:25.707+08:00") public class Order { private Long id = null; diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Pet.java index 316831faf47..7c9c21f4a0f 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Pet.java @@ -1,8 +1,8 @@ package io.swagger.model; import io.swagger.model.Category; -import java.util.*; import io.swagger.model.Tag; +import java.util.*; import io.swagger.annotations.*; import com.fasterxml.jackson.annotation.JsonProperty; @@ -11,7 +11,7 @@ import java.util.Objects; @ApiModel(description = "") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-24T12:32:47.191+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-12-01T23:19:25.707+08:00") public class Pet { private Long id = null; diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Tag.java index de35da0d91c..010842ed2a9 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Tag.java @@ -8,7 +8,7 @@ import java.util.Objects; @ApiModel(description = "") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-24T12:32:47.191+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-12-01T23:19:25.707+08:00") public class Tag { private Long id = null; diff --git a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/User.java index b30037a0d55..dd8c720b7c6 100644 --- a/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/User.java @@ -8,7 +8,7 @@ import java.util.Objects; @ApiModel(description = "") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-24T12:32:47.191+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-12-01T23:19:25.707+08:00") public class User { private Long id = null; diff --git a/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index 5137ffe7912..1907ffd40a5 100644 --- a/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -17,61 +17,62 @@ import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-23T10:25:42.314Z") public class PetApiServiceImpl extends PetApiService { @Override - public Response updatePet(Pet body) + public Response updatePet(Pet body,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response addPet(Pet body) + public Response addPet(Pet body,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response findPetsByStatus(List status) + public Response findPetsByStatus(List status,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response findPetsByTags(List tags) + public Response findPetsByTags(List tags,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response getPetById(Long petId) + public Response getPetById(Long petId,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response updatePetWithForm(String petId,String name,String status) + public Response updatePetWithForm(String petId,String name,String status,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response deletePet(Long petId,String apiKey) + public Response deletePet(Long petId,String apiKey,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response uploadFile(Long petId,String additionalMetadata,FormDataContentDisposition fileDetail) + public Response uploadFile(Long petId,String additionalMetadata,FormDataContentDisposition fileDetail,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 4d9011b4943..c60547a73a0 100644 --- a/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -17,33 +17,34 @@ import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-23T10:25:42.314Z") public class StoreApiServiceImpl extends StoreApiService { @Override - public Response getInventory() + public Response getInventory(SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response placeOrder(Order body) + public Response placeOrder(Order body,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response getOrderById(String orderId) + public Response getOrderById(String orderId,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response deleteOrder(String orderId) + public Response deleteOrder(String orderId,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index 991849edc17..2c3f3edd1fd 100644 --- a/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -17,61 +17,62 @@ import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-23T10:25:42.314Z") public class UserApiServiceImpl extends UserApiService { @Override - public Response createUser(User body) + public Response createUser(User body,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response createUsersWithArrayInput(List body) + public Response createUsersWithArrayInput(List body,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response createUsersWithListInput(List body) + public Response createUsersWithListInput(List body,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response loginUser(String username,String password) + public Response loginUser(String username,String password,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response logoutUser() + public Response logoutUser(SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response getUserByName(String username) + public Response getUserByName(String username,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response updateUser(String username,User body) + public Response updateUser(String username,User body,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response deleteUser(String username) + public Response deleteUser(String username,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();