mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
Merge branch 'master' of https://github.com/karnik/swagger-codegen into karnik-master
This commit is contained in:
commit
658b650285
@ -4,6 +4,9 @@ import {{modelPackage}}.*;
|
||||
import {{package}}.{{classname}}Service;
|
||||
import {{package}}.factories.{{classname}}ServiceFactory;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.jaxrs.*;
|
||||
|
||||
{{#imports}}import {{import}};
|
||||
{{/imports}}
|
||||
|
||||
@ -24,6 +27,7 @@ import javax.validation.constraints.*;
|
||||
@Path("/{{baseName}}")
|
||||
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
|
||||
{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
|
||||
@io.swagger.annotations.Api(description = "the {{baseName}} API")
|
||||
{{>generatedAnnotation}}
|
||||
{{#operations}}
|
||||
public class {{classname}} {
|
||||
@ -34,6 +38,16 @@ public class {{classname}} {
|
||||
{{#subresourceOperation}}@Path("{{path}}"){{/subresourceOperation}}
|
||||
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
|
||||
{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
|
||||
@io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = {
|
||||
{{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = {
|
||||
{{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}},
|
||||
{{/hasMore}}{{/scopes}}
|
||||
}{{/isOAuth}}){{#hasMore}},
|
||||
{{/hasMore}}{{/authMethods}}
|
||||
}{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} })
|
||||
@io.swagger.annotations.ApiResponses(value = { {{#responses}}
|
||||
@io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}},
|
||||
{{/hasMore}}{{/responses}} })
|
||||
public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{^isMultipart}}{{>formParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.{{nickname}}({{#isMultipart}}input,{{/isMultipart}}{{#allParams}}{{^isMultipart}}{{paramName}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}}{{paramName}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}securityContext);
|
||||
|
@ -1 +1 @@
|
||||
{{#isBodyParam}} {{{dataType}}} {{paramName}}{{/isBodyParam}}
|
||||
{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isBodyParam}}
|
@ -1 +1 @@
|
||||
{{#isFormParam}}{{#notFile}}@FormParam("{{paramName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{/isFormParam}}
|
||||
{{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{paramName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{/isFormParam}}
|
@ -1 +1 @@
|
||||
{{#isHeaderParam}}@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}}
|
||||
{{#isHeaderParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}}
|
@ -1,3 +1,6 @@
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
{{#description}}@ApiModel(description="{{{description}}}"){{/description}}
|
||||
{{>generatedAnnotation}}
|
||||
public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} {
|
||||
{{#vars}}{{#isEnum}}
|
||||
@ -14,6 +17,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
|
||||
* maximum: {{maximum}}{{/maximum}}
|
||||
**/
|
||||
{{#vendorExtensions.extraAnnotation}}{{{vendorExtensions.extraAnnotation}}}{{/vendorExtensions.extraAnnotation}}
|
||||
@ApiModelProperty({{#example}}example = "{{example}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}")
|
||||
@JsonProperty("{{baseName}}")
|
||||
{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() {
|
||||
return {{name}};
|
||||
|
@ -4,6 +4,9 @@ import io.swagger.model.*;
|
||||
import io.swagger.api.PetApiService;
|
||||
import io.swagger.api.factories.PetApiServiceFactory;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.jaxrs.*;
|
||||
|
||||
import java.io.File;
|
||||
import io.swagger.model.ModelApiResponse;
|
||||
import io.swagger.model.Pet;
|
||||
@ -23,6 +26,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
|
||||
@Path("/pet")
|
||||
|
||||
|
||||
@io.swagger.annotations.Api(description = "the pet API")
|
||||
|
||||
public class PetApi {
|
||||
private final PetApiService delegate = PetApiServiceFactory.getPetApi();
|
||||
@ -31,7 +35,15 @@ public class PetApi {
|
||||
|
||||
@Consumes({ "application/json", "application/xml" })
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response addPet( Pet body,@Context SecurityContext securityContext)
|
||||
@io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}, 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 body,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.addPet(body,securityContext);
|
||||
}
|
||||
@ -39,7 +51,15 @@ public class PetApi {
|
||||
@Path("/{petId}")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response deletePet( @PathParam("petId") Long petId,@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext)
|
||||
@io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||
public Response deletePet( @PathParam("petId") Long petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.deletePet(petId,apiKey,securityContext);
|
||||
}
|
||||
@ -47,6 +67,16 @@ public class PetApi {
|
||||
@Path("/findByStatus")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") })
|
||||
public Response findPetsByStatus( @NotNull @QueryParam("status") List<String> status,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.findPetsByStatus(status,securityContext);
|
||||
@ -55,6 +85,16 @@ public class PetApi {
|
||||
@Path("/findByTags")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") })
|
||||
public Response findPetsByTags( @NotNull @QueryParam("tags") List<String> tags,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.findPetsByTags(tags,securityContext);
|
||||
@ -63,6 +103,15 @@ public class PetApi {
|
||||
@Path("/{petId}")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "api_key")
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
||||
public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.getPetById(petId,securityContext);
|
||||
@ -71,7 +120,19 @@ public class PetApi {
|
||||
|
||||
@Consumes({ "application/json", "application/xml" })
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response updatePet( Pet body,@Context SecurityContext securityContext)
|
||||
@io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
|
||||
@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 body,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.updatePet(body,securityContext);
|
||||
}
|
||||
@ -79,7 +140,15 @@ public class PetApi {
|
||||
@Path("/{petId}")
|
||||
@Consumes({ "application/x-www-form-urlencoded" })
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response updatePetWithForm( @PathParam("petId") Long petId,@FormParam("name") String name,@FormParam("status") String status,@Context SecurityContext securityContext)
|
||||
@io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
public Response updatePetWithForm( @PathParam("petId") Long 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,securityContext);
|
||||
}
|
||||
@ -87,6 +156,14 @@ public class PetApi {
|
||||
@Path("/{petId}/uploadImage")
|
||||
@Consumes({ "multipart/form-data" })
|
||||
@Produces({ "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||
public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.uploadFile(input,petId,securityContext);
|
||||
|
@ -4,6 +4,9 @@ import io.swagger.model.*;
|
||||
import io.swagger.api.StoreApiService;
|
||||
import io.swagger.api.factories.StoreApiServiceFactory;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.jaxrs.*;
|
||||
|
||||
import java.util.Map;
|
||||
import io.swagger.model.Order;
|
||||
|
||||
@ -21,6 +24,7 @@ import javax.validation.constraints.*;
|
||||
@Path("/store")
|
||||
|
||||
|
||||
@io.swagger.annotations.Api(description = "the store API")
|
||||
|
||||
public class StoreApi {
|
||||
private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi();
|
||||
@ -29,7 +33,12 @@ public class StoreApi {
|
||||
@Path("/order/{orderId}")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response deleteOrder( @Min(1) @PathParam("orderId") String orderId,@Context SecurityContext securityContext)
|
||||
@io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
||||
public Response deleteOrder( @PathParam("orderId") String orderId,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.deleteOrder(orderId,securityContext);
|
||||
}
|
||||
@ -37,6 +46,11 @@ public class StoreApi {
|
||||
@Path("/inventory")
|
||||
|
||||
@Produces({ "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "api_key")
|
||||
}, tags={ "store", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") })
|
||||
public Response getInventory(@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.getInventory(securityContext);
|
||||
@ -45,6 +59,13 @@ public class StoreApi {
|
||||
@Path("/order/{orderId}")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
||||
public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.getOrderById(orderId,securityContext);
|
||||
@ -53,7 +74,12 @@ public class StoreApi {
|
||||
@Path("/order")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response placeOrder( Order body,@Context SecurityContext securityContext)
|
||||
@io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", 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" ,required=true) Order body,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.placeOrder(body,securityContext);
|
||||
}
|
||||
|
@ -4,6 +4,9 @@ import io.swagger.model.*;
|
||||
import io.swagger.api.UserApiService;
|
||||
import io.swagger.api.factories.UserApiServiceFactory;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.jaxrs.*;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.model.User;
|
||||
|
||||
@ -21,6 +24,7 @@ import javax.validation.constraints.*;
|
||||
@Path("/user")
|
||||
|
||||
|
||||
@io.swagger.annotations.Api(description = "the user API")
|
||||
|
||||
public class UserApi {
|
||||
private final UserApiService delegate = UserApiServiceFactory.getUserApi();
|
||||
@ -29,7 +33,10 @@ public class UserApi {
|
||||
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response createUser( User body,@Context SecurityContext securityContext)
|
||||
@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 body,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.createUser(body,securityContext);
|
||||
}
|
||||
@ -37,7 +44,10 @@ public class UserApi {
|
||||
@Path("/createWithArray")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response createUsersWithArrayInput( List<User> body,@Context SecurityContext securityContext)
|
||||
@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> body,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.createUsersWithArrayInput(body,securityContext);
|
||||
}
|
||||
@ -45,7 +55,10 @@ public class UserApi {
|
||||
@Path("/createWithList")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response createUsersWithListInput( List<User> body,@Context SecurityContext securityContext)
|
||||
@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> body,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.createUsersWithListInput(body,securityContext);
|
||||
}
|
||||
@ -53,6 +66,11 @@ public class UserApi {
|
||||
@Path("/{username}")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Delete 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 = 400, message = "Invalid username supplied", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
public Response deleteUser( @PathParam("username") String username,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.deleteUser(username,securityContext);
|
||||
@ -61,6 +79,13 @@ public class UserApi {
|
||||
@Path("/{username}")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) })
|
||||
public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.getUserByName(username,securityContext);
|
||||
@ -69,6 +94,11 @@ public class UserApi {
|
||||
@Path("/login")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
||||
public Response loginUser( @NotNull @QueryParam("username") String username, @NotNull @QueryParam("password") String password,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.loginUser(username,password,securityContext);
|
||||
@ -77,6 +107,9 @@ public class UserApi {
|
||||
@Path("/logout")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", 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 logoutUser(@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.logoutUser(securityContext);
|
||||
@ -85,7 +118,12 @@ public class UserApi {
|
||||
@Path("/{username}")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response updateUser( @PathParam("username") String username, User body,@Context SecurityContext securityContext)
|
||||
@io.swagger.annotations.ApiOperation(value = "Updated 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 = 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 body,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.updateUser(username,body,securityContext);
|
||||
}
|
||||
|
@ -6,6 +6,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import javax.validation.constraints.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel(description="A category for a pet")
|
||||
|
||||
public class Category {
|
||||
|
||||
@ -15,6 +18,7 @@ public class Category {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id")
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -26,6 +30,7 @@ public class Category {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("name")
|
||||
public String getName() {
|
||||
return name;
|
||||
|
@ -6,6 +6,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import javax.validation.constraints.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel(description="Describes the result of uploading an image resource")
|
||||
|
||||
public class ModelApiResponse {
|
||||
|
||||
@ -16,6 +19,7 @@ public class ModelApiResponse {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("code")
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
@ -27,6 +31,7 @@ public class ModelApiResponse {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("type")
|
||||
public String getType() {
|
||||
return type;
|
||||
@ -38,6 +43,7 @@ public class ModelApiResponse {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("message")
|
||||
public String getMessage() {
|
||||
return message;
|
||||
|
@ -8,6 +8,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import java.util.Date;
|
||||
import javax.validation.constraints.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel(description="An order for a pets from the pet store")
|
||||
|
||||
public class Order {
|
||||
|
||||
@ -44,6 +47,7 @@ public class Order {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id")
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -55,6 +59,7 @@ public class Order {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("petId")
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
@ -66,6 +71,7 @@ public class Order {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("quantity")
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
@ -77,6 +83,7 @@ public class Order {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("shipDate")
|
||||
public Date getShipDate() {
|
||||
return shipDate;
|
||||
@ -89,6 +96,7 @@ public class Order {
|
||||
* Order Status
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "Order Status")
|
||||
@JsonProperty("status")
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
@ -100,6 +108,7 @@ public class Order {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("complete")
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
|
@ -10,6 +10,9 @@ import io.swagger.model.Category;
|
||||
import io.swagger.model.Tag;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel(description="A pet for sale in the pet store")
|
||||
|
||||
public class Pet {
|
||||
|
||||
@ -46,6 +49,7 @@ public class Pet {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id")
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -57,6 +61,7 @@ public class Pet {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("category")
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
@ -68,6 +73,7 @@ public class Pet {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@JsonProperty("name")
|
||||
@NotNull
|
||||
public String getName() {
|
||||
@ -80,6 +86,7 @@ public class Pet {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", required = true, value = "")
|
||||
@JsonProperty("photoUrls")
|
||||
@NotNull
|
||||
public List<String> getPhotoUrls() {
|
||||
@ -92,6 +99,7 @@ public class Pet {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("tags")
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
@ -104,6 +112,7 @@ public class Pet {
|
||||
* pet status in the store
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "pet status in the store")
|
||||
@JsonProperty("status")
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
|
@ -6,6 +6,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import javax.validation.constraints.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel(description="A tag for a pet")
|
||||
|
||||
public class Tag {
|
||||
|
||||
@ -15,6 +18,7 @@ public class Tag {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id")
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -26,6 +30,7 @@ public class Tag {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("name")
|
||||
public String getName() {
|
||||
return name;
|
||||
|
@ -6,6 +6,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import javax.validation.constraints.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel(description="A User who is purchasing from the pet store")
|
||||
|
||||
public class User {
|
||||
|
||||
@ -21,6 +24,7 @@ public class User {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id")
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -32,6 +36,7 @@ public class User {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("username")
|
||||
public String getUsername() {
|
||||
return username;
|
||||
@ -43,6 +48,7 @@ public class User {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("firstName")
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
@ -54,6 +60,7 @@ public class User {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("lastName")
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
@ -65,6 +72,7 @@ public class User {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("email")
|
||||
public String getEmail() {
|
||||
return email;
|
||||
@ -76,6 +84,7 @@ public class User {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("password")
|
||||
public String getPassword() {
|
||||
return password;
|
||||
@ -87,6 +96,7 @@ public class User {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("phone")
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
@ -99,6 +109,7 @@ public class User {
|
||||
* User Status
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "User Status")
|
||||
@JsonProperty("userStatus")
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
|
@ -4,6 +4,9 @@ import io.swagger.model.*;
|
||||
import io.swagger.api.PetApiService;
|
||||
import io.swagger.api.factories.PetApiServiceFactory;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.jaxrs.*;
|
||||
|
||||
import java.io.File;
|
||||
import io.swagger.model.ModelApiResponse;
|
||||
import io.swagger.model.Pet;
|
||||
@ -22,6 +25,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
|
||||
@Path("/pet")
|
||||
|
||||
|
||||
@io.swagger.annotations.Api(description = "the pet API")
|
||||
|
||||
public class PetApi {
|
||||
private final PetApiService delegate = PetApiServiceFactory.getPetApi();
|
||||
@ -30,7 +34,15 @@ public class PetApi {
|
||||
|
||||
@Consumes({ "application/json", "application/xml" })
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response addPet( Pet body,@Context SecurityContext securityContext)
|
||||
@io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}, 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 body,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.addPet(body,securityContext);
|
||||
}
|
||||
@ -38,7 +50,15 @@ public class PetApi {
|
||||
@Path("/{petId}")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response deletePet( @PathParam("petId") Long petId,@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext)
|
||||
@io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||
public Response deletePet( @PathParam("petId") Long petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.deletePet(petId,apiKey,securityContext);
|
||||
}
|
||||
@ -46,6 +66,16 @@ public class PetApi {
|
||||
@Path("/findByStatus")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") })
|
||||
public Response findPetsByStatus( @QueryParam("status") List<String> status,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.findPetsByStatus(status,securityContext);
|
||||
@ -54,6 +84,16 @@ public class PetApi {
|
||||
@Path("/findByTags")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") })
|
||||
public Response findPetsByTags( @QueryParam("tags") List<String> tags,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.findPetsByTags(tags,securityContext);
|
||||
@ -62,6 +102,15 @@ public class PetApi {
|
||||
@Path("/{petId}")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "api_key")
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
||||
public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.getPetById(petId,securityContext);
|
||||
@ -70,7 +119,19 @@ public class PetApi {
|
||||
|
||||
@Consumes({ "application/json", "application/xml" })
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response updatePet( Pet body,@Context SecurityContext securityContext)
|
||||
@io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
|
||||
@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 body,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.updatePet(body,securityContext);
|
||||
}
|
||||
@ -78,7 +139,15 @@ public class PetApi {
|
||||
@Path("/{petId}")
|
||||
@Consumes({ "application/x-www-form-urlencoded" })
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response updatePetWithForm( @PathParam("petId") Long petId,@FormParam("name") String name,@FormParam("status") String status,@Context SecurityContext securityContext)
|
||||
@io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
public Response updatePetWithForm( @PathParam("petId") Long 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,securityContext);
|
||||
}
|
||||
@ -86,6 +155,14 @@ public class PetApi {
|
||||
@Path("/{petId}/uploadImage")
|
||||
@Consumes({ "multipart/form-data" })
|
||||
@Produces({ "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||
public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.uploadFile(input,petId,securityContext);
|
||||
|
@ -4,6 +4,9 @@ import io.swagger.model.*;
|
||||
import io.swagger.api.StoreApiService;
|
||||
import io.swagger.api.factories.StoreApiServiceFactory;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.jaxrs.*;
|
||||
|
||||
import java.util.Map;
|
||||
import io.swagger.model.Order;
|
||||
|
||||
@ -20,6 +23,7 @@ import javax.ws.rs.*;
|
||||
@Path("/store")
|
||||
|
||||
|
||||
@io.swagger.annotations.Api(description = "the store API")
|
||||
|
||||
public class StoreApi {
|
||||
private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi();
|
||||
@ -28,6 +32,11 @@ public class StoreApi {
|
||||
@Path("/order/{orderId}")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
||||
public Response deleteOrder( @PathParam("orderId") String orderId,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.deleteOrder(orderId,securityContext);
|
||||
@ -36,6 +45,11 @@ public class StoreApi {
|
||||
@Path("/inventory")
|
||||
|
||||
@Produces({ "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "api_key")
|
||||
}, tags={ "store", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") })
|
||||
public Response getInventory(@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.getInventory(securityContext);
|
||||
@ -44,6 +58,13 @@ public class StoreApi {
|
||||
@Path("/order/{orderId}")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
||||
public Response getOrderById( @PathParam("orderId") Long orderId,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.getOrderById(orderId,securityContext);
|
||||
@ -52,7 +73,12 @@ public class StoreApi {
|
||||
@Path("/order")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response placeOrder( Order body,@Context SecurityContext securityContext)
|
||||
@io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", 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" ,required=true) Order body,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.placeOrder(body,securityContext);
|
||||
}
|
||||
|
@ -4,6 +4,9 @@ import io.swagger.model.*;
|
||||
import io.swagger.api.UserApiService;
|
||||
import io.swagger.api.factories.UserApiServiceFactory;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.jaxrs.*;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.model.User;
|
||||
|
||||
@ -20,6 +23,7 @@ import javax.ws.rs.*;
|
||||
@Path("/user")
|
||||
|
||||
|
||||
@io.swagger.annotations.Api(description = "the user API")
|
||||
|
||||
public class UserApi {
|
||||
private final UserApiService delegate = UserApiServiceFactory.getUserApi();
|
||||
@ -28,7 +32,10 @@ public class UserApi {
|
||||
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response createUser( User body,@Context SecurityContext securityContext)
|
||||
@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 body,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.createUser(body,securityContext);
|
||||
}
|
||||
@ -36,7 +43,10 @@ public class UserApi {
|
||||
@Path("/createWithArray")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response createUsersWithArrayInput( List<User> body,@Context SecurityContext securityContext)
|
||||
@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> body,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.createUsersWithArrayInput(body,securityContext);
|
||||
}
|
||||
@ -44,7 +54,10 @@ public class UserApi {
|
||||
@Path("/createWithList")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response createUsersWithListInput( List<User> body,@Context SecurityContext securityContext)
|
||||
@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> body,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.createUsersWithListInput(body,securityContext);
|
||||
}
|
||||
@ -52,6 +65,11 @@ public class UserApi {
|
||||
@Path("/{username}")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Delete 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 = 400, message = "Invalid username supplied", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
public Response deleteUser( @PathParam("username") String username,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.deleteUser(username,securityContext);
|
||||
@ -60,6 +78,13 @@ public class UserApi {
|
||||
@Path("/{username}")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) })
|
||||
public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.getUserByName(username,securityContext);
|
||||
@ -68,6 +93,11 @@ public class UserApi {
|
||||
@Path("/login")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
||||
public Response loginUser( @QueryParam("username") String username, @QueryParam("password") String password,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.loginUser(username,password,securityContext);
|
||||
@ -76,6 +106,9 @@ public class UserApi {
|
||||
@Path("/logout")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", 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 logoutUser(@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.logoutUser(securityContext);
|
||||
@ -84,7 +117,12 @@ public class UserApi {
|
||||
@Path("/{username}")
|
||||
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
public Response updateUser( @PathParam("username") String username, User body,@Context SecurityContext securityContext)
|
||||
@io.swagger.annotations.ApiOperation(value = "Updated 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 = 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 body,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.updateUser(username,body,securityContext);
|
||||
}
|
||||
|
@ -6,6 +6,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel(description="A category for a pet")
|
||||
|
||||
public class Category {
|
||||
|
||||
@ -15,6 +18,7 @@ public class Category {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id")
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -26,6 +30,7 @@ public class Category {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("name")
|
||||
public String getName() {
|
||||
return name;
|
||||
|
@ -6,6 +6,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel(description="Describes the result of uploading an image resource")
|
||||
|
||||
public class ModelApiResponse {
|
||||
|
||||
@ -16,6 +19,7 @@ public class ModelApiResponse {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("code")
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
@ -27,6 +31,7 @@ public class ModelApiResponse {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("type")
|
||||
public String getType() {
|
||||
return type;
|
||||
@ -38,6 +43,7 @@ public class ModelApiResponse {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("message")
|
||||
public String getMessage() {
|
||||
return message;
|
||||
|
@ -8,6 +8,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel(description="An order for a pets from the pet store")
|
||||
|
||||
public class Order {
|
||||
|
||||
@ -44,6 +47,7 @@ public class Order {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id")
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -55,6 +59,7 @@ public class Order {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("petId")
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
@ -66,6 +71,7 @@ public class Order {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("quantity")
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
@ -77,6 +83,7 @@ public class Order {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("shipDate")
|
||||
public DateTime getShipDate() {
|
||||
return shipDate;
|
||||
@ -89,6 +96,7 @@ public class Order {
|
||||
* Order Status
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "Order Status")
|
||||
@JsonProperty("status")
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
@ -100,6 +108,7 @@ public class Order {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("complete")
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
|
@ -10,6 +10,9 @@ import io.swagger.model.Category;
|
||||
import io.swagger.model.Tag;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel(description="A pet for sale in the pet store")
|
||||
|
||||
public class Pet {
|
||||
|
||||
@ -46,6 +49,7 @@ public class Pet {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id")
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -57,6 +61,7 @@ public class Pet {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("category")
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
@ -68,6 +73,7 @@ public class Pet {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@JsonProperty("name")
|
||||
public String getName() {
|
||||
return name;
|
||||
@ -79,6 +85,7 @@ public class Pet {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", required = true, value = "")
|
||||
@JsonProperty("photoUrls")
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
@ -90,6 +97,7 @@ public class Pet {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("tags")
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
@ -102,6 +110,7 @@ public class Pet {
|
||||
* pet status in the store
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "pet status in the store")
|
||||
@JsonProperty("status")
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
|
@ -6,6 +6,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel(description="A tag for a pet")
|
||||
|
||||
public class Tag {
|
||||
|
||||
@ -15,6 +18,7 @@ public class Tag {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id")
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -26,6 +30,7 @@ public class Tag {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("name")
|
||||
public String getName() {
|
||||
return name;
|
||||
|
@ -6,6 +6,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel(description="A User who is purchasing from the pet store")
|
||||
|
||||
public class User {
|
||||
|
||||
@ -21,6 +24,7 @@ public class User {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id")
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -32,6 +36,7 @@ public class User {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("username")
|
||||
public String getUsername() {
|
||||
return username;
|
||||
@ -43,6 +48,7 @@ public class User {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("firstName")
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
@ -54,6 +60,7 @@ public class User {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("lastName")
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
@ -65,6 +72,7 @@ public class User {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("email")
|
||||
public String getEmail() {
|
||||
return email;
|
||||
@ -76,6 +84,7 @@ public class User {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("password")
|
||||
public String getPassword() {
|
||||
return password;
|
||||
@ -87,6 +96,7 @@ public class User {
|
||||
/**
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("phone")
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
@ -99,6 +109,7 @@ public class User {
|
||||
* User Status
|
||||
**/
|
||||
|
||||
@ApiModelProperty(example = "null", value = "User Status")
|
||||
@JsonProperty("userStatus")
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
|
Loading…
Reference in New Issue
Block a user