forked from loafle/openapi-generator-original
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:
parent
f9185c3f6f
commit
acda5d0bc5
@ -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!
|
@ -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) {
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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<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 {
|
||||
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<String> tags)
|
||||
public Response findPetsByTags(@ApiParam(value = "Tags to filter by") @QueryParam("tags") List<String> 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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<String> status)
|
||||
public abstract Response findPetsByStatus(List<String> status,SecurityContext securityContext)
|
||||
throws NotFoundException;
|
||||
|
||||
public abstract Response findPetsByTags(List<String> tags)
|
||||
public abstract Response findPetsByTags(List<String> 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;
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
}
|
||||
|
@ -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<User> body)
|
||||
public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ) List<User> 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<User> body)
|
||||
public Response createUsersWithListInput(@ApiParam(value = "List of user object" ) List<User> 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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<User> body)
|
||||
public abstract Response createUsersWithArrayInput(List<User> body,SecurityContext securityContext)
|
||||
throws NotFoundException;
|
||||
|
||||
public abstract Response createUsersWithListInput(List<User> body)
|
||||
public abstract Response createUsersWithListInput(List<User> 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;
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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<String> status)
|
||||
public Response findPetsByStatus(List<String> status,SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
// do some magic!
|
||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response findPetsByTags(List<String> tags)
|
||||
public Response findPetsByTags(List<String> 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();
|
||||
|
@ -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();
|
||||
|
@ -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<User> body)
|
||||
public Response createUsersWithArrayInput(List<User> body,SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
// do some magic!
|
||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response createUsersWithListInput(List<User> body)
|
||||
public Response createUsersWithListInput(List<User> 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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user