Update samples for JAXRS server SecurityContext

Conflicts:
	samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Category.java
	samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Order.java
	samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Pet.java
	samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/Tag.java
	samples/server/petstore/jaxrs/src/gen/java/io/swagger/model/User.java
This commit is contained in:
Nick Maynard 2015-11-23 10:26:32 +00:00 committed by wing328
parent f9185c3f6f
commit acda5d0bc5
19 changed files with 121 additions and 110 deletions

View File

@ -12,3 +12,12 @@ To run the server, please execute the following:
``` ```
mvn clean package jetty:run 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!

View File

@ -1,6 +1,6 @@
package io.swagger.api; 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{ public class ApiException extends Exception{
private int code; private int code;
public ApiException (int code, String msg) { public ApiException (int code, String msg) {

View File

@ -5,7 +5,7 @@ import java.io.IOException;
import javax.servlet.*; import javax.servlet.*;
import javax.servlet.http.HttpServletResponse; 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 class ApiOriginFilter implements javax.servlet.Filter {
public void doFilter(ServletRequest request, ServletResponse response, public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException { FilterChain chain) throws IOException, ServletException {

View File

@ -3,7 +3,7 @@ package io.swagger.api;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
@javax.xml.bind.annotation.XmlRootElement @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 class ApiResponseMessage {
public static final int ERROR = 1; public static final int ERROR = 1;
public static final int WARNING = 2; public static final int WARNING = 2;

View File

@ -1,6 +1,6 @@
package io.swagger.api; 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 { public class NotFoundException extends ApiException {
private int code; private int code;
public NotFoundException (int code, String msg) { public NotFoundException (int code, String msg) {

View File

@ -19,14 +19,16 @@ import java.io.InputStream;
import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.core.header.FormDataContentDisposition;
import com.sun.jersey.multipart.FormDataParam; import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.*; import javax.ws.rs.*;
@Path("/pet") @Path("/pet")
@io.swagger.annotations.Api(description = "the pet API") @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 { public class PetApi {
private final PetApiService delegate = PetApiServiceFactory.getPetApi(); 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) }) @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 { throws NotFoundException {
return delegate.updatePet(body); return delegate.updatePet(body,securityContext);
} }
@POST @POST
@ -64,9 +66,9 @@ public class PetApi {
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) @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 { throws NotFoundException {
return delegate.addPet(body); return delegate.addPet(body,securityContext);
} }
@GET @GET
@Path("/findByStatus") @Path("/findByStatus")
@ -83,9 +85,9 @@ public class PetApi {
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") }) @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<String> status) public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", defaultValue="available") @QueryParam("status") List<String> status,@Context SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
return delegate.findPetsByStatus(status); return delegate.findPetsByStatus(status,securityContext);
} }
@GET @GET
@Path("/findByTags") @Path("/findByTags")
@ -102,9 +104,9 @@ public class PetApi {
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) @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<String> tags) public Response findPetsByTags(@ApiParam(value = "Tags to filter by") @QueryParam("tags") List<String> tags,@Context SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
return delegate.findPetsByTags(tags); return delegate.findPetsByTags(tags,securityContext);
} }
@GET @GET
@Path("/{petId}") @Path("/{petId}")
@ -120,9 +122,9 @@ public class PetApi {
@io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) @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 { throws NotFoundException {
return delegate.getPetById(petId); return delegate.getPetById(petId,securityContext);
} }
@POST @POST
@Path("/{petId}") @Path("/{petId}")
@ -137,11 +139,9 @@ public class PetApi {
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) @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, 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)
@ApiParam(value = "Updated name of the pet")@FormParam("name") String name,
@ApiParam(value = "Updated status of the pet")@FormParam("status") String status)
throws NotFoundException { throws NotFoundException {
return delegate.updatePetWithForm(petId,name,status); return delegate.updatePetWithForm(petId,name,status,securityContext);
} }
@DELETE @DELETE
@Path("/{petId}") @Path("/{petId}")
@ -156,10 +156,9 @@ public class PetApi {
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) @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, 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)
@ApiParam(value = "" )@HeaderParam("api_key") String apiKey)
throws NotFoundException { throws NotFoundException {
return delegate.deletePet(petId,apiKey); return delegate.deletePet(petId,apiKey,securityContext);
} }
@POST @POST
@Path("/{petId}/uploadImage") @Path("/{petId}/uploadImage")
@ -174,12 +173,9 @@ public class PetApi {
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @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, 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,
@ApiParam(value = "Additional data to pass to server")@FormParam("additionalMetadata") String additionalMetadata, @FormDataParam("file") FormDataContentDisposition fileDetail,@Context SecurityContext securityContext)
@FormDataParam("file") InputStream inputStream,
@FormDataParam("file") FormDataContentDisposition fileDetail)
throws NotFoundException { throws NotFoundException {
return delegate.uploadFile(petId,additionalMetadata,fileDetail); return delegate.uploadFile(petId,additionalMetadata,fileDetail,securityContext);
} }
} }

View File

@ -17,32 +17,33 @@ import com.sun.jersey.core.header.FormDataContentDisposition;
import com.sun.jersey.multipart.FormDataParam; import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response; 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 class PetApiService {
public abstract Response updatePet(Pet body) public abstract Response updatePet(Pet body,SecurityContext securityContext)
throws NotFoundException; throws NotFoundException;
public abstract Response addPet(Pet body) public abstract Response addPet(Pet body,SecurityContext securityContext)
throws NotFoundException; throws NotFoundException;
public abstract Response findPetsByStatus(List<String> status) public abstract Response findPetsByStatus(List<String> status,SecurityContext securityContext)
throws NotFoundException; throws NotFoundException;
public abstract Response findPetsByTags(List<String> tags) public abstract Response findPetsByTags(List<String> tags,SecurityContext securityContext)
throws NotFoundException; throws NotFoundException;
public abstract Response getPetById(Long petId) public abstract Response getPetById(Long petId,SecurityContext securityContext)
throws NotFoundException; 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; throws NotFoundException;
public abstract Response deletePet(Long petId,String apiKey) public abstract Response deletePet(Long petId,String apiKey,SecurityContext securityContext)
throws NotFoundException; 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; throws NotFoundException;
} }

View File

@ -19,14 +19,16 @@ import java.io.InputStream;
import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.core.header.FormDataContentDisposition;
import com.sun.jersey.multipart.FormDataParam; import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.*; import javax.ws.rs.*;
@Path("/store") @Path("/store")
@io.swagger.annotations.Api(description = "the store API") @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 { public class StoreApi {
private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi(); private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi();
@ -40,9 +42,9 @@ public class StoreApi {
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) @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 { throws NotFoundException {
return delegate.getInventory(); return delegate.getInventory(securityContext);
} }
@POST @POST
@Path("/order") @Path("/order")
@ -54,9 +56,9 @@ public class StoreApi {
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) @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 { throws NotFoundException {
return delegate.placeOrder(body); return delegate.placeOrder(body,securityContext);
} }
@GET @GET
@Path("/order/{orderId}") @Path("/order/{orderId}")
@ -70,9 +72,9 @@ public class StoreApi {
@io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) @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 { throws NotFoundException {
return delegate.getOrderById(orderId); return delegate.getOrderById(orderId,securityContext);
} }
@DELETE @DELETE
@Path("/order/{orderId}") @Path("/order/{orderId}")
@ -84,9 +86,8 @@ public class StoreApi {
@io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) @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 { throws NotFoundException {
return delegate.deleteOrder(orderId); return delegate.deleteOrder(orderId,securityContext);
} }
} }

View File

@ -17,20 +17,21 @@ import com.sun.jersey.core.header.FormDataContentDisposition;
import com.sun.jersey.multipart.FormDataParam; import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response; 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 class StoreApiService {
public abstract Response getInventory() public abstract Response getInventory(SecurityContext securityContext)
throws NotFoundException; throws NotFoundException;
public abstract Response placeOrder(Order body) public abstract Response placeOrder(Order body,SecurityContext securityContext)
throws NotFoundException; throws NotFoundException;
public abstract Response getOrderById(String orderId) public abstract Response getOrderById(String orderId,SecurityContext securityContext)
throws NotFoundException; throws NotFoundException;
public abstract Response deleteOrder(String orderId) public abstract Response deleteOrder(String orderId,SecurityContext securityContext)
throws NotFoundException; throws NotFoundException;
} }

View File

@ -19,14 +19,16 @@ import java.io.InputStream;
import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.core.header.FormDataContentDisposition;
import com.sun.jersey.multipart.FormDataParam; import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.*; import javax.ws.rs.*;
@Path("/user") @Path("/user")
@io.swagger.annotations.Api(description = "the user API") @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 { public class UserApi {
private final UserApiService delegate = UserApiServiceFactory.getUserApi(); private final UserApiService delegate = UserApiServiceFactory.getUserApi();
@ -38,9 +40,9 @@ public class UserApi {
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @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 { throws NotFoundException {
return delegate.createUser(body); return delegate.createUser(body,securityContext);
} }
@POST @POST
@Path("/createWithArray") @Path("/createWithArray")
@ -50,9 +52,9 @@ public class UserApi {
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) })
public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ) List<User> body) public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ) List<User> body,@Context SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
return delegate.createUsersWithArrayInput(body); return delegate.createUsersWithArrayInput(body,securityContext);
} }
@POST @POST
@Path("/createWithList") @Path("/createWithList")
@ -62,9 +64,9 @@ public class UserApi {
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) })
public Response createUsersWithListInput(@ApiParam(value = "List of user object" ) List<User> body) public Response createUsersWithListInput(@ApiParam(value = "List of user object" ) List<User> body,@Context SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
return delegate.createUsersWithListInput(body); return delegate.createUsersWithListInput(body,securityContext);
} }
@GET @GET
@Path("/login") @Path("/login")
@ -76,10 +78,9 @@ public class UserApi {
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) @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, 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)
@ApiParam(value = "The password for login in clear text") @QueryParam("password") String password)
throws NotFoundException { throws NotFoundException {
return delegate.loginUser(username,password); return delegate.loginUser(username,password,securityContext);
} }
@GET @GET
@Path("/logout") @Path("/logout")
@ -89,9 +90,9 @@ public class UserApi {
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) })
public Response logoutUser() public Response logoutUser(@Context SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
return delegate.logoutUser(); return delegate.logoutUser(securityContext);
} }
@GET @GET
@Path("/{username}") @Path("/{username}")
@ -105,9 +106,9 @@ public class UserApi {
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) @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 { throws NotFoundException {
return delegate.getUserByName(username); return delegate.getUserByName(username,securityContext);
} }
@PUT @PUT
@Path("/{username}") @Path("/{username}")
@ -119,10 +120,9 @@ public class UserApi {
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) @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, 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)
@ApiParam(value = "Updated user object" ) User body)
throws NotFoundException { throws NotFoundException {
return delegate.updateUser(username,body); return delegate.updateUser(username,body,securityContext);
} }
@DELETE @DELETE
@Path("/{username}") @Path("/{username}")
@ -134,9 +134,8 @@ public class UserApi {
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) @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 { throws NotFoundException {
return delegate.deleteUser(username); return delegate.deleteUser(username,securityContext);
} }
} }

View File

@ -17,32 +17,33 @@ import com.sun.jersey.core.header.FormDataContentDisposition;
import com.sun.jersey.multipart.FormDataParam; import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response; 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 class UserApiService {
public abstract Response createUser(User body) public abstract Response createUser(User body,SecurityContext securityContext)
throws NotFoundException; throws NotFoundException;
public abstract Response createUsersWithArrayInput(List<User> body) public abstract Response createUsersWithArrayInput(List<User> body,SecurityContext securityContext)
throws NotFoundException; throws NotFoundException;
public abstract Response createUsersWithListInput(List<User> body) public abstract Response createUsersWithListInput(List<User> body,SecurityContext securityContext)
throws NotFoundException; throws NotFoundException;
public abstract Response loginUser(String username,String password) public abstract Response loginUser(String username,String password,SecurityContext securityContext)
throws NotFoundException; throws NotFoundException;
public abstract Response logoutUser() public abstract Response logoutUser(SecurityContext securityContext)
throws NotFoundException; throws NotFoundException;
public abstract Response getUserByName(String username) public abstract Response getUserByName(String username,SecurityContext securityContext)
throws NotFoundException; throws NotFoundException;
public abstract Response updateUser(String username,User body) public abstract Response updateUser(String username,User body,SecurityContext securityContext)
throws NotFoundException; throws NotFoundException;
public abstract Response deleteUser(String username) public abstract Response deleteUser(String username,SecurityContext securityContext)
throws NotFoundException; throws NotFoundException;
} }

View File

@ -8,7 +8,7 @@ import java.util.Objects;
@ApiModel(description = "") @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 { public class Category {
private Long id = null; private Long id = null;

View File

@ -9,7 +9,7 @@ import java.util.Objects;
@ApiModel(description = "") @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 { public class Order {
private Long id = null; private Long id = null;

View File

@ -1,8 +1,8 @@
package io.swagger.model; package io.swagger.model;
import io.swagger.model.Category; import io.swagger.model.Category;
import java.util.*;
import io.swagger.model.Tag; import io.swagger.model.Tag;
import java.util.*;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
@ -11,7 +11,7 @@ import java.util.Objects;
@ApiModel(description = "") @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 { public class Pet {
private Long id = null; private Long id = null;

View File

@ -8,7 +8,7 @@ import java.util.Objects;
@ApiModel(description = "") @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 { public class Tag {
private Long id = null; private Long id = null;

View File

@ -8,7 +8,7 @@ import java.util.Objects;
@ApiModel(description = "") @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 { public class User {
private Long id = null; private Long id = null;

View File

@ -17,61 +17,62 @@ import com.sun.jersey.core.header.FormDataContentDisposition;
import com.sun.jersey.multipart.FormDataParam; import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response; 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 { public class PetApiServiceImpl extends PetApiService {
@Override @Override
public Response updatePet(Pet body) public Response updatePet(Pet body,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response addPet(Pet body) public Response addPet(Pet body,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response findPetsByStatus(List<String> status) public Response findPetsByStatus(List<String> status,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response findPetsByTags(List<String> tags) public Response findPetsByTags(List<String> tags,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response getPetById(Long petId) public Response getPetById(Long petId,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response updatePetWithForm(String petId,String name,String status) public Response updatePetWithForm(String petId,String name,String status,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response deletePet(Long petId,String apiKey) public Response deletePet(Long petId,String apiKey,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response uploadFile(Long petId,String additionalMetadata,FormDataContentDisposition fileDetail) public Response uploadFile(Long petId,String additionalMetadata,FormDataContentDisposition fileDetail,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();

View File

@ -17,33 +17,34 @@ import com.sun.jersey.core.header.FormDataContentDisposition;
import com.sun.jersey.multipart.FormDataParam; import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response; 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 { public class StoreApiServiceImpl extends StoreApiService {
@Override @Override
public Response getInventory() public Response getInventory(SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response placeOrder(Order body) public Response placeOrder(Order body,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response getOrderById(String orderId) public Response getOrderById(String orderId,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response deleteOrder(String orderId) public Response deleteOrder(String orderId,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();

View File

@ -17,61 +17,62 @@ import com.sun.jersey.core.header.FormDataContentDisposition;
import com.sun.jersey.multipart.FormDataParam; import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response; 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 { public class UserApiServiceImpl extends UserApiService {
@Override @Override
public Response createUser(User body) public Response createUser(User body,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response createUsersWithArrayInput(List<User> body) public Response createUsersWithArrayInput(List<User> body,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response createUsersWithListInput(List<User> body) public Response createUsersWithListInput(List<User> body,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response loginUser(String username,String password) public Response loginUser(String username,String password,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response logoutUser() public Response logoutUser(SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response getUserByName(String username) public Response getUserByName(String username,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response updateUser(String username,User body) public Response updateUser(String username,User body,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
} }
@Override @Override
public Response deleteUser(String username) public Response deleteUser(String username,SecurityContext securityContext)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();