forked from loafle/openapi-generator-original
[Java][jaxrs-resteasy] add @Valid when bean validation is enabled (#1237)
This commit is contained in:
parent
258de8909d
commit
0aec7728f9
@ -23,6 +23,7 @@ import javax.inject.Inject;
|
||||
|
||||
{{#useBeanValidation}}
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
{{/useBeanValidation}}
|
||||
{{#operations}}{{#operation}}{{#isMultipart}}import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
|
||||
{{/isMultipart}}{{/operation}}{{/operations}}
|
||||
|
@ -1 +1 @@
|
||||
{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isBodyParam}}
|
||||
{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#useBeanValidation}}{{#required}} @NotNull{{/required}} @Valid{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isBodyParam}}
|
@ -19,6 +19,7 @@ import javax.ws.rs.core.SecurityContext;
|
||||
import javax.ws.rs.*;
|
||||
{{#useBeanValidation}}
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
{{/useBeanValidation}}
|
||||
{{#operations}}{{#operation}}{{#isMultipart}}import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
|
||||
{{/isMultipart}}{{/operation}}{{/operations}}
|
||||
|
@ -1 +1 @@
|
||||
{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isBodyParam}}
|
||||
{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#useBeanValidation}}{{#required}} @NotNull{{/required}} @Valid{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isBodyParam}}
|
@ -23,6 +23,7 @@ import javax.ws.rs.*;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
|
||||
|
||||
@Path("/pet")
|
||||
@ -46,7 +47,7 @@ public class PetApi {
|
||||
}, tags={ "pet", })
|
||||
@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" ,required=true) Pet pet,@Context SecurityContext securityContext)
|
||||
public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet pet,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return service.addPet(pet,securityContext);
|
||||
}
|
||||
@ -135,7 +136,7 @@ public class PetApi {
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", 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" ,required=true) Pet pet,@Context SecurityContext securityContext)
|
||||
public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet pet,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return service.updatePet(pet,securityContext);
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import javax.ws.rs.*;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Path("/store")
|
||||
|
||||
@ -82,7 +83,7 @@ public class StoreApi {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) })
|
||||
public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order,@Context SecurityContext securityContext)
|
||||
public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) @NotNull @Valid Order order,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return service.placeOrder(order,securityContext);
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import javax.ws.rs.*;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Path("/user")
|
||||
|
||||
@ -39,7 +40,7 @@ public class UserApi {
|
||||
@io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@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" ,required=true) User user,@Context SecurityContext securityContext)
|
||||
public Response createUser(@ApiParam(value = "Created user object" ,required=true) @NotNull @Valid User user,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return service.createUser(user,securityContext);
|
||||
}
|
||||
@ -50,7 +51,7 @@ public class UserApi {
|
||||
@io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@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" ,required=true) List<User> user,@Context SecurityContext securityContext)
|
||||
public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) @NotNull @Valid List<User> user,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return service.createUsersWithArrayInput(user,securityContext);
|
||||
}
|
||||
@ -61,7 +62,7 @@ public class UserApi {
|
||||
@io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@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" ,required=true) List<User> user,@Context SecurityContext securityContext)
|
||||
public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) @NotNull @Valid List<User> user,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return service.createUsersWithListInput(user,securityContext);
|
||||
}
|
||||
@ -126,7 +127,7 @@ public class UserApi {
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) User user,@Context SecurityContext securityContext)
|
||||
public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) @NotNull @Valid User user,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return service.updateUser(username,user,securityContext);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.ws.rs.*;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
|
||||
|
||||
@Path("/pet")
|
||||
@ -40,7 +41,7 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@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" ,required=true) Pet pet,@Context SecurityContext securityContext);
|
||||
public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet pet,@Context SecurityContext securityContext);
|
||||
@DELETE
|
||||
@Path("/{petId}")
|
||||
|
||||
@ -114,7 +115,7 @@ public interface PetApi {
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", 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" ,required=true) Pet pet,@Context SecurityContext securityContext);
|
||||
public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet pet,@Context SecurityContext securityContext);
|
||||
@POST
|
||||
@Path("/{petId}")
|
||||
@Consumes({ "application/x-www-form-urlencoded" })
|
||||
|
@ -18,6 +18,7 @@ import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.ws.rs.*;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Path("/store")
|
||||
|
||||
@ -67,5 +68,5 @@ public interface StoreApi {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) })
|
||||
public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order,@Context SecurityContext securityContext);
|
||||
public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) @NotNull @Valid Order order,@Context SecurityContext securityContext);
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.ws.rs.*;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Path("/user")
|
||||
|
||||
@ -33,7 +34,7 @@ public interface UserApi {
|
||||
@io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@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" ,required=true) User user,@Context SecurityContext securityContext);
|
||||
public Response createUser(@ApiParam(value = "Created user object" ,required=true) @NotNull @Valid User user,@Context SecurityContext securityContext);
|
||||
@POST
|
||||
@Path("/createWithArray")
|
||||
|
||||
@ -41,7 +42,7 @@ public interface UserApi {
|
||||
@io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@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" ,required=true) List<User> user,@Context SecurityContext securityContext);
|
||||
public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) @NotNull @Valid List<User> user,@Context SecurityContext securityContext);
|
||||
@POST
|
||||
@Path("/createWithList")
|
||||
|
||||
@ -49,7 +50,7 @@ public interface UserApi {
|
||||
@io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@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" ,required=true) List<User> user,@Context SecurityContext securityContext);
|
||||
public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) @NotNull @Valid List<User> user,@Context SecurityContext securityContext);
|
||||
@DELETE
|
||||
@Path("/{username}")
|
||||
|
||||
@ -99,5 +100,5 @@ public interface UserApi {
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) User user,@Context SecurityContext securityContext);
|
||||
public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) @NotNull @Valid User user,@Context SecurityContext securityContext);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.ws.rs.*;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
|
||||
|
||||
@Path("/pet")
|
||||
@ -40,7 +41,7 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@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" ,required=true) Pet pet,@Context SecurityContext securityContext);
|
||||
public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet pet,@Context SecurityContext securityContext);
|
||||
@DELETE
|
||||
@Path("/{petId}")
|
||||
|
||||
@ -114,7 +115,7 @@ public interface PetApi {
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", 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" ,required=true) Pet pet,@Context SecurityContext securityContext);
|
||||
public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet pet,@Context SecurityContext securityContext);
|
||||
@POST
|
||||
@Path("/{petId}")
|
||||
@Consumes({ "application/x-www-form-urlencoded" })
|
||||
|
@ -18,6 +18,7 @@ import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.ws.rs.*;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Path("/store")
|
||||
|
||||
@ -67,5 +68,5 @@ public interface StoreApi {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) })
|
||||
public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order,@Context SecurityContext securityContext);
|
||||
public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) @NotNull @Valid Order order,@Context SecurityContext securityContext);
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.ws.rs.*;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Path("/user")
|
||||
|
||||
@ -33,7 +34,7 @@ public interface UserApi {
|
||||
@io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@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" ,required=true) User user,@Context SecurityContext securityContext);
|
||||
public Response createUser(@ApiParam(value = "Created user object" ,required=true) @NotNull @Valid User user,@Context SecurityContext securityContext);
|
||||
@POST
|
||||
@Path("/createWithArray")
|
||||
|
||||
@ -41,7 +42,7 @@ public interface UserApi {
|
||||
@io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@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" ,required=true) List<User> user,@Context SecurityContext securityContext);
|
||||
public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) @NotNull @Valid List<User> user,@Context SecurityContext securityContext);
|
||||
@POST
|
||||
@Path("/createWithList")
|
||||
|
||||
@ -49,7 +50,7 @@ public interface UserApi {
|
||||
@io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@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" ,required=true) List<User> user,@Context SecurityContext securityContext);
|
||||
public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) @NotNull @Valid List<User> user,@Context SecurityContext securityContext);
|
||||
@DELETE
|
||||
@Path("/{username}")
|
||||
|
||||
@ -99,5 +100,5 @@ public interface UserApi {
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) User user,@Context SecurityContext securityContext);
|
||||
public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) @NotNull @Valid User user,@Context SecurityContext securityContext);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.ws.rs.*;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
|
||||
|
||||
@Path("/pet")
|
||||
@ -40,7 +41,7 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@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" ,required=true) Pet pet,@Context SecurityContext securityContext);
|
||||
public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet pet,@Context SecurityContext securityContext);
|
||||
@DELETE
|
||||
@Path("/{petId}")
|
||||
|
||||
@ -114,7 +115,7 @@ public interface PetApi {
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", 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" ,required=true) Pet pet,@Context SecurityContext securityContext);
|
||||
public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet pet,@Context SecurityContext securityContext);
|
||||
@POST
|
||||
@Path("/{petId}")
|
||||
@Consumes({ "application/x-www-form-urlencoded" })
|
||||
|
@ -18,6 +18,7 @@ import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.ws.rs.*;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Path("/store")
|
||||
|
||||
@ -67,5 +68,5 @@ public interface StoreApi {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) })
|
||||
public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order,@Context SecurityContext securityContext);
|
||||
public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) @NotNull @Valid Order order,@Context SecurityContext securityContext);
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.ws.rs.*;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Path("/user")
|
||||
|
||||
@ -33,7 +34,7 @@ public interface UserApi {
|
||||
@io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@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" ,required=true) User user,@Context SecurityContext securityContext);
|
||||
public Response createUser(@ApiParam(value = "Created user object" ,required=true) @NotNull @Valid User user,@Context SecurityContext securityContext);
|
||||
@POST
|
||||
@Path("/createWithArray")
|
||||
|
||||
@ -41,7 +42,7 @@ public interface UserApi {
|
||||
@io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@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" ,required=true) List<User> user,@Context SecurityContext securityContext);
|
||||
public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) @NotNull @Valid List<User> user,@Context SecurityContext securityContext);
|
||||
@POST
|
||||
@Path("/createWithList")
|
||||
|
||||
@ -49,7 +50,7 @@ public interface UserApi {
|
||||
@io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@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" ,required=true) List<User> user,@Context SecurityContext securityContext);
|
||||
public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) @NotNull @Valid List<User> user,@Context SecurityContext securityContext);
|
||||
@DELETE
|
||||
@Path("/{username}")
|
||||
|
||||
@ -99,5 +100,5 @@ public interface UserApi {
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) User user,@Context SecurityContext securityContext);
|
||||
public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) @NotNull @Valid User user,@Context SecurityContext securityContext);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import javax.ws.rs.*;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
|
||||
|
||||
@Path("/pet")
|
||||
@ -46,7 +47,7 @@ public class PetApi {
|
||||
}, tags={ "pet", })
|
||||
@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" ,required=true) Pet pet,@Context SecurityContext securityContext)
|
||||
public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet pet,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return service.addPet(pet,securityContext);
|
||||
}
|
||||
@ -135,7 +136,7 @@ public class PetApi {
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", 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" ,required=true) Pet pet,@Context SecurityContext securityContext)
|
||||
public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet pet,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return service.updatePet(pet,securityContext);
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import javax.ws.rs.*;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Path("/store")
|
||||
|
||||
@ -82,7 +83,7 @@ public class StoreApi {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) })
|
||||
public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order,@Context SecurityContext securityContext)
|
||||
public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) @NotNull @Valid Order order,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return service.placeOrder(order,securityContext);
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import javax.ws.rs.*;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Path("/user")
|
||||
|
||||
@ -39,7 +40,7 @@ public class UserApi {
|
||||
@io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@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" ,required=true) User user,@Context SecurityContext securityContext)
|
||||
public Response createUser(@ApiParam(value = "Created user object" ,required=true) @NotNull @Valid User user,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return service.createUser(user,securityContext);
|
||||
}
|
||||
@ -50,7 +51,7 @@ public class UserApi {
|
||||
@io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@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" ,required=true) List<User> user,@Context SecurityContext securityContext)
|
||||
public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) @NotNull @Valid List<User> user,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return service.createUsersWithArrayInput(user,securityContext);
|
||||
}
|
||||
@ -61,7 +62,7 @@ public class UserApi {
|
||||
@io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@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" ,required=true) List<User> user,@Context SecurityContext securityContext)
|
||||
public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) @NotNull @Valid List<User> user,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return service.createUsersWithListInput(user,securityContext);
|
||||
}
|
||||
@ -126,7 +127,7 @@ public class UserApi {
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) User user,@Context SecurityContext securityContext)
|
||||
public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) @NotNull @Valid User user,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return service.updateUser(username,user,securityContext);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user