[Java][JAXRS-CXF] Improve API documentation in the CXF Server stub and Client generation (#6708)

* Inclusion of API documentation in CXF Server stub generation

* Inclusion of API documentation in CXF client generation

* Update of the Petstore CXF server sample

* Update of the Petstore CXF client sample

* Update of the Petstore CXF server annotated base path sample

* Update of the Petstore CXF server non spring application sample

* Changed {{{appDescription}}} to {{appDescription}} to use the HTML-escaped value in handling special characters like <, > in the description following the correction made by @wing328

* Update of the Petstore CXF samples
This commit is contained in:
Gustavo Paz 2017-10-22 10:00:48 -05:00 committed by wing328
parent d2eb7cb35b
commit 7cbd36e75b
63 changed files with 1247 additions and 2 deletions

View File

@ -22,6 +22,16 @@ import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
{{/useBeanValidation}} {{/useBeanValidation}}
{{#appName}}
/**
* {{{appName}}}
*
{{#appDescription}}
* <p>{{{appDescription}}}
*
{{/appDescription}}
*/
{{/appName}}
@Path("{{^useAnnotatedBasePath}}/{{/useAnnotatedBasePath}}{{#useAnnotatedBasePath}}{{contextPath}}{{/useAnnotatedBasePath}}") @Path("{{^useAnnotatedBasePath}}/{{/useAnnotatedBasePath}}{{#useAnnotatedBasePath}}{{contextPath}}{{/useAnnotatedBasePath}}")
@Api(value = "/", description = "{{description}}") @Api(value = "/", description = "{{description}}")
{{#addConsumesProducesJson}} {{#addConsumesProducesJson}}
@ -32,6 +42,16 @@ public interface {{classname}} {
{{#operations}} {{#operations}}
{{#operation}} {{#operation}}
{{#summary}}
/**
* {{summary}}
*
{{#notes}}
* {{notes}}
*
{{/notes}}
*/
{{/summary}}
@{{httpMethod}} @{{httpMethod}}
{{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}}
{{#hasConsumes}} {{#hasConsumes}}

View File

@ -25,9 +25,29 @@ import org.springframework.stereotype.Service;
{{/useSpringAnnotationConfig}} {{/useSpringAnnotationConfig}}
{{#description}} {{#description}}
{{/description}} {{/description}}
{{#appName}}
/**
* {{{appName}}}
*
{{#appDescription}}
* <p>{{{appDescription}}}
{{/appDescription}}
*
*/
{{/appName}}
public class {{classname}}ServiceImpl implements {{classname}} { public class {{classname}}ServiceImpl implements {{classname}} {
{{#operations}} {{#operations}}
{{#operation}} {{#operation}}
{{#summary}}
/**
* {{summary}}
*
{{#notes}}
* {{notes}}
*
{{/notes}}
*/
{{/summary}}
public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>bodyParamsImpl}}{{>formParamsImpl}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>bodyParamsImpl}}{{>formParamsImpl}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {
// TODO: Implement... // TODO: Implement...

View File

@ -42,6 +42,14 @@ import org.springframework.test.context.web.WebAppConfiguration;
/** /**
{{#appName}}
* {{{appName}}}
*
{{/appName}}
{{#appDescription}}
* <p>{{{appDescription}}}
*
{{/appDescription}}
* API tests for {{classname}} * API tests for {{classname}}
*/ */
{{#generateSpringBootApplication}} {{#generateSpringBootApplication}}
@ -91,10 +99,14 @@ public class {{classname}}Test {
{{#operations}}{{#operation}} {{#operations}}{{#operation}}
/** /**
{{#summary}}
* {{summary}} * {{summary}}
* *
{{#notes}}
* {{notes}} * {{notes}}
* *
{{/notes}}
{{/summary}}
* @throws ApiException * @throws ApiException
* if the Api call fails * if the Api call fails
*/ */

View File

@ -17,6 +17,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
{{^parent}}@XmlRootElement(name="{{classname}}"){{/parent}} {{^parent}}@XmlRootElement(name="{{classname}}"){{/parent}}
{{/withXml}} {{/withXml}}
{{#description}} {{#description}}
/**
* {{{description}}}
**/
@ApiModel(description="{{{description}}}") @ApiModel(description="{{{description}}}")
{{/description}} {{/description}}
public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} { public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
@ -29,6 +32,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
@XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}}) @XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}})
{{/withXml}} {{/withXml}}
@ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}")
{{#description}}
/**
* {{{description}}}
**/
{{/description}}
private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/vars}} private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/vars}}
{{#vars}} {{#vars}}

View File

@ -4,6 +4,9 @@
<artifactId>{{artifactId}}</artifactId> <artifactId>{{artifactId}}</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>{{artifactId}}</name> <name>{{artifactId}}</name>
{{#appDescription}}
<description>{{appDescription}}</description>
{{/appDescription}}
<version>{{artifactVersion}}</version> <version>{{artifactVersion}}</version>
<build> <build>
<sourceDirectory>src/main/java</sourceDirectory> <sourceDirectory>src/main/java</sourceDirectory>

View File

@ -4,6 +4,9 @@
<artifactId>{{artifactId}}</artifactId> <artifactId>{{artifactId}}</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<name>{{artifactId}}</name> <name>{{artifactId}}</name>
{{#appDescription}}
<description>{{appDescription}}</description>
{{/appDescription}}
<version>{{artifactVersion}}</version> <version>{{artifactVersion}}</version>
<build> <build>
<sourceDirectory>src/main/java</sourceDirectory> <sourceDirectory>src/main/java</sourceDirectory>

View File

@ -4,6 +4,7 @@
<artifactId>jaxrs-cxf-petstore-client</artifactId> <artifactId>jaxrs-cxf-petstore-client</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<name>jaxrs-cxf-petstore-client</name> <name>jaxrs-cxf-petstore-client</name>
<description>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key &#x60;special-key&#x60; to test the authorization filters.</description>
<version>1.0.0</version> <version>1.0.0</version>
<build> <build>
<sourceDirectory>src/main/java</sourceDirectory> <sourceDirectory>src/main/java</sourceDirectory>

View File

@ -21,10 +21,22 @@ import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
/**
* Swagger Petstore
*
* <p>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
@Path("/") @Path("/")
@Api(value = "/", description = "") @Api(value = "/", description = "")
public interface PetApi { public interface PetApi {
/**
* Add a new pet to the store
*
*
*
*/
@POST @POST
@Path("/pet") @Path("/pet")
@Consumes({ "application/json", "application/xml" }) @Consumes({ "application/json", "application/xml" })
@ -34,6 +46,12 @@ public interface PetApi {
@ApiResponse(code = 405, message = "Invalid input") }) @ApiResponse(code = 405, message = "Invalid input") })
public void addPet(@Valid Pet body); public void addPet(@Valid Pet body);
/**
* Deletes a pet
*
*
*
*/
@DELETE @DELETE
@Path("/pet/{petId}") @Path("/pet/{petId}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -42,6 +60,12 @@ public interface PetApi {
@ApiResponse(code = 400, message = "Invalid pet value") }) @ApiResponse(code = 400, message = "Invalid pet value") })
public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey);
/**
* Finds Pets by status
*
* Multiple status values can be provided with comma separated strings
*
*/
@GET @GET
@Path("/pet/findByStatus") @Path("/pet/findByStatus")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -51,6 +75,12 @@ public interface PetApi {
@ApiResponse(code = 400, message = "Invalid status value") }) @ApiResponse(code = 400, message = "Invalid status value") })
public List<Pet> findPetsByStatus(@QueryParam("status") @NotNull List<String> status); public List<Pet> findPetsByStatus(@QueryParam("status") @NotNull List<String> status);
/**
* Finds Pets by tags
*
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
*
*/
@GET @GET
@Path("/pet/findByTags") @Path("/pet/findByTags")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -60,6 +90,12 @@ public interface PetApi {
@ApiResponse(code = 400, message = "Invalid tag value") }) @ApiResponse(code = 400, message = "Invalid tag value") })
public List<Pet> findPetsByTags(@QueryParam("tags") @NotNull List<String> tags); public List<Pet> findPetsByTags(@QueryParam("tags") @NotNull List<String> tags);
/**
* Find pet by ID
*
* Returns a single pet
*
*/
@GET @GET
@Path("/pet/{petId}") @Path("/pet/{petId}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -70,6 +106,12 @@ public interface PetApi {
@ApiResponse(code = 404, message = "Pet not found") }) @ApiResponse(code = 404, message = "Pet not found") })
public Pet getPetById(@PathParam("petId") Long petId); public Pet getPetById(@PathParam("petId") Long petId);
/**
* Update an existing pet
*
*
*
*/
@PUT @PUT
@Path("/pet") @Path("/pet")
@Consumes({ "application/json", "application/xml" }) @Consumes({ "application/json", "application/xml" })
@ -81,6 +123,12 @@ public interface PetApi {
@ApiResponse(code = 405, message = "Validation exception") }) @ApiResponse(code = 405, message = "Validation exception") })
public void updatePet(@Valid Pet body); public void updatePet(@Valid Pet body);
/**
* Updates a pet in the store with form data
*
*
*
*/
@POST @POST
@Path("/pet/{petId}") @Path("/pet/{petId}")
@Consumes({ "application/x-www-form-urlencoded" }) @Consumes({ "application/x-www-form-urlencoded" })
@ -90,6 +138,12 @@ public interface PetApi {
@ApiResponse(code = 405, message = "Invalid input") }) @ApiResponse(code = 405, message = "Invalid input") })
public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status);
/**
* uploads an image
*
*
*
*/
@POST @POST
@Path("/pet/{petId}/uploadImage") @Path("/pet/{petId}/uploadImage")
@Consumes({ "multipart/form-data" }) @Consumes({ "multipart/form-data" })

View File

@ -20,10 +20,22 @@ import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
/**
* Swagger Petstore
*
* <p>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
@Path("/") @Path("/")
@Api(value = "/", description = "") @Api(value = "/", description = "")
public interface StoreApi { public interface StoreApi {
/**
* Delete purchase order by ID
*
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
*
*/
@DELETE @DELETE
@Path("/store/order/{orderId}") @Path("/store/order/{orderId}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -33,6 +45,12 @@ public interface StoreApi {
@ApiResponse(code = 404, message = "Order not found") }) @ApiResponse(code = 404, message = "Order not found") })
public void deleteOrder(@PathParam("orderId") String orderId); public void deleteOrder(@PathParam("orderId") String orderId);
/**
* Returns pet inventories by status
*
* Returns a map of status codes to quantities
*
*/
@GET @GET
@Path("/store/inventory") @Path("/store/inventory")
@Produces({ "application/json" }) @Produces({ "application/json" })
@ -41,6 +59,12 @@ public interface StoreApi {
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") })
public Map<String, Integer> getInventory(); public Map<String, Integer> getInventory();
/**
* Find purchase order by ID
*
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
*
*/
@GET @GET
@Path("/store/order/{orderId}") @Path("/store/order/{orderId}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -51,6 +75,12 @@ public interface StoreApi {
@ApiResponse(code = 404, message = "Order not found") }) @ApiResponse(code = 404, message = "Order not found") })
public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId); public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId);
/**
* Place an order for a pet
*
*
*
*/
@POST @POST
@Path("/store/order") @Path("/store/order")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })

View File

@ -20,10 +20,22 @@ import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
/**
* Swagger Petstore
*
* <p>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
@Path("/") @Path("/")
@Api(value = "/", description = "") @Api(value = "/", description = "")
public interface UserApi { public interface UserApi {
/**
* Create user
*
* This can only be done by the logged in user.
*
*/
@POST @POST
@Path("/user") @Path("/user")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -32,6 +44,12 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") }) @ApiResponse(code = 200, message = "successful operation") })
public void createUser(@Valid User body); public void createUser(@Valid User body);
/**
* Creates list of users with given input array
*
*
*
*/
@POST @POST
@Path("/user/createWithArray") @Path("/user/createWithArray")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -40,6 +58,12 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") }) @ApiResponse(code = 200, message = "successful operation") })
public void createUsersWithArrayInput(@Valid List<User> body); public void createUsersWithArrayInput(@Valid List<User> body);
/**
* Creates list of users with given input array
*
*
*
*/
@POST @POST
@Path("/user/createWithList") @Path("/user/createWithList")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -48,6 +72,12 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") }) @ApiResponse(code = 200, message = "successful operation") })
public void createUsersWithListInput(@Valid List<User> body); public void createUsersWithListInput(@Valid List<User> body);
/**
* Delete user
*
* This can only be done by the logged in user.
*
*/
@DELETE @DELETE
@Path("/user/{username}") @Path("/user/{username}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -57,6 +87,12 @@ public interface UserApi {
@ApiResponse(code = 404, message = "User not found") }) @ApiResponse(code = 404, message = "User not found") })
public void deleteUser(@PathParam("username") String username); public void deleteUser(@PathParam("username") String username);
/**
* Get user by user name
*
*
*
*/
@GET @GET
@Path("/user/{username}") @Path("/user/{username}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -67,6 +103,12 @@ public interface UserApi {
@ApiResponse(code = 404, message = "User not found") }) @ApiResponse(code = 404, message = "User not found") })
public User getUserByName(@PathParam("username") String username); public User getUserByName(@PathParam("username") String username);
/**
* Logs user into the system
*
*
*
*/
@GET @GET
@Path("/user/login") @Path("/user/login")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -76,6 +118,12 @@ public interface UserApi {
@ApiResponse(code = 400, message = "Invalid username/password supplied") }) @ApiResponse(code = 400, message = "Invalid username/password supplied") })
public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password);
/**
* Logs out current logged in user session
*
*
*
*/
@GET @GET
@Path("/user/logout") @Path("/user/logout")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -84,6 +132,12 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") }) @ApiResponse(code = 200, message = "successful operation") })
public void logoutUser(); public void logoutUser();
/**
* Updated user
*
* This can only be done by the logged in user.
*
*/
@PUT @PUT
@Path("/user/{username}") @Path("/user/{username}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })

View File

@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A category for a pet
**/
@ApiModel(description="A category for a pet") @ApiModel(description="A category for a pet")
public class Category { public class Category {

View File

@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Describes the result of uploading an image resource
**/
@ApiModel(description="Describes the result of uploading an image resource") @ApiModel(description="Describes the result of uploading an image resource")
public class ModelApiResponse { public class ModelApiResponse {

View File

@ -14,6 +14,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* An order for a pets from the pet store
**/
@ApiModel(description="An order for a pets from the pet store") @ApiModel(description="An order for a pets from the pet store")
public class Order { public class Order {
@ -59,6 +62,9 @@ public enum StatusEnum {
} }
@ApiModelProperty(value = "Order Status") @ApiModelProperty(value = "Order Status")
/**
* Order Status
**/
private StatusEnum status = null; private StatusEnum status = null;
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
private Boolean complete = false; private Boolean complete = false;

View File

@ -17,6 +17,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A pet for sale in the pet store
**/
@ApiModel(description="A pet for sale in the pet store") @ApiModel(description="A pet for sale in the pet store")
public class Pet { public class Pet {
@ -64,6 +67,9 @@ public enum StatusEnum {
} }
@ApiModelProperty(value = "pet status in the store") @ApiModelProperty(value = "pet status in the store")
/**
* pet status in the store
**/
private StatusEnum status = null; private StatusEnum status = null;
/** /**

View File

@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A tag for a pet
**/
@ApiModel(description="A tag for a pet") @ApiModel(description="A tag for a pet")
public class Tag { public class Tag {

View File

@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A User who is purchasing from the pet store
**/
@ApiModel(description="A User who is purchasing from the pet store") @ApiModel(description="A User who is purchasing from the pet store")
public class User { public class User {
@ -31,6 +34,9 @@ public class User {
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
private String phone = null; private String phone = null;
@ApiModelProperty(value = "User Status") @ApiModelProperty(value = "User Status")
/**
* User Status
**/
private Integer userStatus = null; private Integer userStatus = null;
/** /**

View File

@ -4,6 +4,7 @@
<artifactId>swagger-cxf-annotated-basepath</artifactId> <artifactId>swagger-cxf-annotated-basepath</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<name>swagger-cxf-annotated-basepath</name> <name>swagger-cxf-annotated-basepath</name>
<description>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key &#x60;special-key&#x60; to test the authorization filters.</description>
<version>1.0.0</version> <version>1.0.0</version>
<build> <build>
<sourceDirectory>src/main/java</sourceDirectory> <sourceDirectory>src/main/java</sourceDirectory>

View File

@ -21,10 +21,22 @@ import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
/**
* Swagger Petstore
*
* <p>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
@Path("/v2") @Path("/v2")
@Api(value = "/", description = "") @Api(value = "/", description = "")
public interface PetApi { public interface PetApi {
/**
* Add a new pet to the store
*
*
*
*/
@POST @POST
@Path("/pet") @Path("/pet")
@Consumes({ "application/json", "application/xml" }) @Consumes({ "application/json", "application/xml" })
@ -34,6 +46,12 @@ public interface PetApi {
@ApiResponse(code = 405, message = "Invalid input") }) @ApiResponse(code = 405, message = "Invalid input") })
public void addPet(@Valid Pet body); public void addPet(@Valid Pet body);
/**
* Deletes a pet
*
*
*
*/
@DELETE @DELETE
@Path("/pet/{petId}") @Path("/pet/{petId}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -42,6 +60,12 @@ public interface PetApi {
@ApiResponse(code = 400, message = "Invalid pet value") }) @ApiResponse(code = 400, message = "Invalid pet value") })
public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey);
/**
* Finds Pets by status
*
* Multiple status values can be provided with comma separated strings
*
*/
@GET @GET
@Path("/pet/findByStatus") @Path("/pet/findByStatus")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -51,6 +75,12 @@ public interface PetApi {
@ApiResponse(code = 400, message = "Invalid status value") }) @ApiResponse(code = 400, message = "Invalid status value") })
public List<Pet> findPetsByStatus(@QueryParam("status") @NotNull List<String> status); public List<Pet> findPetsByStatus(@QueryParam("status") @NotNull List<String> status);
/**
* Finds Pets by tags
*
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
*
*/
@GET @GET
@Path("/pet/findByTags") @Path("/pet/findByTags")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -60,6 +90,12 @@ public interface PetApi {
@ApiResponse(code = 400, message = "Invalid tag value") }) @ApiResponse(code = 400, message = "Invalid tag value") })
public List<Pet> findPetsByTags(@QueryParam("tags") @NotNull List<String> tags); public List<Pet> findPetsByTags(@QueryParam("tags") @NotNull List<String> tags);
/**
* Find pet by ID
*
* Returns a single pet
*
*/
@GET @GET
@Path("/pet/{petId}") @Path("/pet/{petId}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -70,6 +106,12 @@ public interface PetApi {
@ApiResponse(code = 404, message = "Pet not found") }) @ApiResponse(code = 404, message = "Pet not found") })
public Pet getPetById(@PathParam("petId") Long petId); public Pet getPetById(@PathParam("petId") Long petId);
/**
* Update an existing pet
*
*
*
*/
@PUT @PUT
@Path("/pet") @Path("/pet")
@Consumes({ "application/json", "application/xml" }) @Consumes({ "application/json", "application/xml" })
@ -81,6 +123,12 @@ public interface PetApi {
@ApiResponse(code = 405, message = "Validation exception") }) @ApiResponse(code = 405, message = "Validation exception") })
public void updatePet(@Valid Pet body); public void updatePet(@Valid Pet body);
/**
* Updates a pet in the store with form data
*
*
*
*/
@POST @POST
@Path("/pet/{petId}") @Path("/pet/{petId}")
@Consumes({ "application/x-www-form-urlencoded" }) @Consumes({ "application/x-www-form-urlencoded" })
@ -90,6 +138,12 @@ public interface PetApi {
@ApiResponse(code = 405, message = "Invalid input") }) @ApiResponse(code = 405, message = "Invalid input") })
public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status);
/**
* uploads an image
*
*
*
*/
@POST @POST
@Path("/pet/{petId}/uploadImage") @Path("/pet/{petId}/uploadImage")
@Consumes({ "multipart/form-data" }) @Consumes({ "multipart/form-data" })

View File

@ -20,10 +20,22 @@ import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
/**
* Swagger Petstore
*
* <p>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
@Path("/v2") @Path("/v2")
@Api(value = "/", description = "") @Api(value = "/", description = "")
public interface StoreApi { public interface StoreApi {
/**
* Delete purchase order by ID
*
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
*
*/
@DELETE @DELETE
@Path("/store/order/{orderId}") @Path("/store/order/{orderId}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -33,6 +45,12 @@ public interface StoreApi {
@ApiResponse(code = 404, message = "Order not found") }) @ApiResponse(code = 404, message = "Order not found") })
public void deleteOrder(@PathParam("orderId") String orderId); public void deleteOrder(@PathParam("orderId") String orderId);
/**
* Returns pet inventories by status
*
* Returns a map of status codes to quantities
*
*/
@GET @GET
@Path("/store/inventory") @Path("/store/inventory")
@Produces({ "application/json" }) @Produces({ "application/json" })
@ -41,6 +59,12 @@ public interface StoreApi {
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") })
public Map<String, Integer> getInventory(); public Map<String, Integer> getInventory();
/**
* Find purchase order by ID
*
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
*
*/
@GET @GET
@Path("/store/order/{orderId}") @Path("/store/order/{orderId}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -51,6 +75,12 @@ public interface StoreApi {
@ApiResponse(code = 404, message = "Order not found") }) @ApiResponse(code = 404, message = "Order not found") })
public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId); public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId);
/**
* Place an order for a pet
*
*
*
*/
@POST @POST
@Path("/store/order") @Path("/store/order")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })

View File

@ -20,10 +20,22 @@ import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
/**
* Swagger Petstore
*
* <p>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
@Path("/v2") @Path("/v2")
@Api(value = "/", description = "") @Api(value = "/", description = "")
public interface UserApi { public interface UserApi {
/**
* Create user
*
* This can only be done by the logged in user.
*
*/
@POST @POST
@Path("/user") @Path("/user")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -32,6 +44,12 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") }) @ApiResponse(code = 200, message = "successful operation") })
public void createUser(@Valid User body); public void createUser(@Valid User body);
/**
* Creates list of users with given input array
*
*
*
*/
@POST @POST
@Path("/user/createWithArray") @Path("/user/createWithArray")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -40,6 +58,12 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") }) @ApiResponse(code = 200, message = "successful operation") })
public void createUsersWithArrayInput(@Valid List<User> body); public void createUsersWithArrayInput(@Valid List<User> body);
/**
* Creates list of users with given input array
*
*
*
*/
@POST @POST
@Path("/user/createWithList") @Path("/user/createWithList")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -48,6 +72,12 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") }) @ApiResponse(code = 200, message = "successful operation") })
public void createUsersWithListInput(@Valid List<User> body); public void createUsersWithListInput(@Valid List<User> body);
/**
* Delete user
*
* This can only be done by the logged in user.
*
*/
@DELETE @DELETE
@Path("/user/{username}") @Path("/user/{username}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -57,6 +87,12 @@ public interface UserApi {
@ApiResponse(code = 404, message = "User not found") }) @ApiResponse(code = 404, message = "User not found") })
public void deleteUser(@PathParam("username") String username); public void deleteUser(@PathParam("username") String username);
/**
* Get user by user name
*
*
*
*/
@GET @GET
@Path("/user/{username}") @Path("/user/{username}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -67,6 +103,12 @@ public interface UserApi {
@ApiResponse(code = 404, message = "User not found") }) @ApiResponse(code = 404, message = "User not found") })
public User getUserByName(@PathParam("username") String username); public User getUserByName(@PathParam("username") String username);
/**
* Logs user into the system
*
*
*
*/
@GET @GET
@Path("/user/login") @Path("/user/login")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -76,6 +118,12 @@ public interface UserApi {
@ApiResponse(code = 400, message = "Invalid username/password supplied") }) @ApiResponse(code = 400, message = "Invalid username/password supplied") })
public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password);
/**
* Logs out current logged in user session
*
*
*
*/
@GET @GET
@Path("/user/logout") @Path("/user/logout")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -84,6 +132,12 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") }) @ApiResponse(code = 200, message = "successful operation") })
public void logoutUser(); public void logoutUser();
/**
* Updated user
*
* This can only be done by the logged in user.
*
*/
@PUT @PUT
@Path("/user/{username}") @Path("/user/{username}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })

View File

@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A category for a pet
**/
@ApiModel(description="A category for a pet") @ApiModel(description="A category for a pet")
public class Category { public class Category {

View File

@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Describes the result of uploading an image resource
**/
@ApiModel(description="Describes the result of uploading an image resource") @ApiModel(description="Describes the result of uploading an image resource")
public class ModelApiResponse { public class ModelApiResponse {

View File

@ -14,6 +14,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* An order for a pets from the pet store
**/
@ApiModel(description="An order for a pets from the pet store") @ApiModel(description="An order for a pets from the pet store")
public class Order { public class Order {
@ -59,6 +62,9 @@ public enum StatusEnum {
} }
@ApiModelProperty(value = "Order Status") @ApiModelProperty(value = "Order Status")
/**
* Order Status
**/
private StatusEnum status = null; private StatusEnum status = null;
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
private Boolean complete = false; private Boolean complete = false;

View File

@ -17,6 +17,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A pet for sale in the pet store
**/
@ApiModel(description="A pet for sale in the pet store") @ApiModel(description="A pet for sale in the pet store")
public class Pet { public class Pet {
@ -64,6 +67,9 @@ public enum StatusEnum {
} }
@ApiModelProperty(value = "pet status in the store") @ApiModelProperty(value = "pet status in the store")
/**
* pet status in the store
**/
private StatusEnum status = null; private StatusEnum status = null;
/** /**

View File

@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A tag for a pet
**/
@ApiModel(description="A tag for a pet") @ApiModel(description="A tag for a pet")
public class Tag { public class Tag {

View File

@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A User who is purchasing from the pet store
**/
@ApiModel(description="A User who is purchasing from the pet store") @ApiModel(description="A User who is purchasing from the pet store")
public class User { public class User {
@ -31,6 +34,9 @@ public class User {
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
private String phone = null; private String phone = null;
@ApiModelProperty(value = "User Status") @ApiModelProperty(value = "User Status")
/**
* User Status
**/
private Integer userStatus = null; private Integer userStatus = null;
/** /**

View File

@ -18,49 +18,103 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
/**
* Swagger Petstore
*
* <p>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
public class PetApiServiceImpl implements PetApi { public class PetApiServiceImpl implements PetApi {
/**
* Add a new pet to the store
*
*
*
*/
public void addPet(Pet body) { public void addPet(Pet body) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Deletes a pet
*
*
*
*/
public void deletePet(Long petId, String apiKey) { public void deletePet(Long petId, String apiKey) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Finds Pets by status
*
* Multiple status values can be provided with comma separated strings
*
*/
public List<Pet> findPetsByStatus(List<String> status) { public List<Pet> findPetsByStatus(List<String> status) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Finds Pets by tags
*
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
*
*/
public List<Pet> findPetsByTags(List<String> tags) { public List<Pet> findPetsByTags(List<String> tags) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Find pet by ID
*
* Returns a single pet
*
*/
public Pet getPetById(Long petId) { public Pet getPetById(Long petId) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Update an existing pet
*
*
*
*/
public void updatePet(Pet body) { public void updatePet(Pet body) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Updates a pet in the store with form data
*
*
*
*/
public void updatePetWithForm(Long petId, String name, String status) { public void updatePetWithForm(Long petId, String name, String status) {
// TODO: Implement... // TODO: Implement...
} }
/**
* uploads an image
*
*
*
*/
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Attachment fileDetail) { public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Attachment fileDetail) {
// TODO: Implement... // TODO: Implement...

View File

@ -17,25 +17,55 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
/**
* Swagger Petstore
*
* <p>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
public class StoreApiServiceImpl implements StoreApi { public class StoreApiServiceImpl implements StoreApi {
/**
* Delete purchase order by ID
*
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
*
*/
public void deleteOrder(String orderId) { public void deleteOrder(String orderId) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Returns pet inventories by status
*
* Returns a map of status codes to quantities
*
*/
public Map<String, Integer> getInventory() { public Map<String, Integer> getInventory() {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Find purchase order by ID
*
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
*
*/
public Order getOrderById(Long orderId) { public Order getOrderById(Long orderId) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Place an order for a pet
*
*
*
*/
public Order placeOrder(Order body) { public Order placeOrder(Order body) {
// TODO: Implement... // TODO: Implement...

View File

@ -17,49 +17,103 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
/**
* Swagger Petstore
*
* <p>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
public class UserApiServiceImpl implements UserApi { public class UserApiServiceImpl implements UserApi {
/**
* Create user
*
* This can only be done by the logged in user.
*
*/
public void createUser(User body) { public void createUser(User body) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Creates list of users with given input array
*
*
*
*/
public void createUsersWithArrayInput(List<User> body) { public void createUsersWithArrayInput(List<User> body) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Creates list of users with given input array
*
*
*
*/
public void createUsersWithListInput(List<User> body) { public void createUsersWithListInput(List<User> body) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Delete user
*
* This can only be done by the logged in user.
*
*/
public void deleteUser(String username) { public void deleteUser(String username) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Get user by user name
*
*
*
*/
public User getUserByName(String username) { public User getUserByName(String username) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Logs user into the system
*
*
*
*/
public String loginUser(String username, String password) { public String loginUser(String username, String password) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Logs out current logged in user session
*
*
*
*/
public void logoutUser() { public void logoutUser() {
// TODO: Implement... // TODO: Implement...
} }
/**
* Updated user
*
* This can only be done by the logged in user.
*
*/
public void updateUser(String username, User body) { public void updateUser(String username, User body) {
// TODO: Implement... // TODO: Implement...

View File

@ -4,6 +4,7 @@
<artifactId>swagger-cxf-server-non-spring</artifactId> <artifactId>swagger-cxf-server-non-spring</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<name>swagger-cxf-server-non-spring</name> <name>swagger-cxf-server-non-spring</name>
<description>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key &#x60;special-key&#x60; to test the authorization filters.</description>
<version>1.0.0</version> <version>1.0.0</version>
<build> <build>
<sourceDirectory>src/main/java</sourceDirectory> <sourceDirectory>src/main/java</sourceDirectory>

View File

@ -21,10 +21,22 @@ import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
/**
* Swagger Petstore
*
* <p>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
@Path("/") @Path("/")
@Api(value = "/", description = "") @Api(value = "/", description = "")
public interface PetApi { public interface PetApi {
/**
* Add a new pet to the store
*
*
*
*/
@POST @POST
@Path("/pet") @Path("/pet")
@Consumes({ "application/json", "application/xml" }) @Consumes({ "application/json", "application/xml" })
@ -34,6 +46,12 @@ public interface PetApi {
@ApiResponse(code = 405, message = "Invalid input") }) @ApiResponse(code = 405, message = "Invalid input") })
public void addPet(@Valid Pet body); public void addPet(@Valid Pet body);
/**
* Deletes a pet
*
*
*
*/
@DELETE @DELETE
@Path("/pet/{petId}") @Path("/pet/{petId}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -42,6 +60,12 @@ public interface PetApi {
@ApiResponse(code = 400, message = "Invalid pet value") }) @ApiResponse(code = 400, message = "Invalid pet value") })
public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey);
/**
* Finds Pets by status
*
* Multiple status values can be provided with comma separated strings
*
*/
@GET @GET
@Path("/pet/findByStatus") @Path("/pet/findByStatus")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -51,6 +75,12 @@ public interface PetApi {
@ApiResponse(code = 400, message = "Invalid status value") }) @ApiResponse(code = 400, message = "Invalid status value") })
public List<Pet> findPetsByStatus(@QueryParam("status") @NotNull List<String> status); public List<Pet> findPetsByStatus(@QueryParam("status") @NotNull List<String> status);
/**
* Finds Pets by tags
*
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
*
*/
@GET @GET
@Path("/pet/findByTags") @Path("/pet/findByTags")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -60,6 +90,12 @@ public interface PetApi {
@ApiResponse(code = 400, message = "Invalid tag value") }) @ApiResponse(code = 400, message = "Invalid tag value") })
public List<Pet> findPetsByTags(@QueryParam("tags") @NotNull List<String> tags); public List<Pet> findPetsByTags(@QueryParam("tags") @NotNull List<String> tags);
/**
* Find pet by ID
*
* Returns a single pet
*
*/
@GET @GET
@Path("/pet/{petId}") @Path("/pet/{petId}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -70,6 +106,12 @@ public interface PetApi {
@ApiResponse(code = 404, message = "Pet not found") }) @ApiResponse(code = 404, message = "Pet not found") })
public Pet getPetById(@PathParam("petId") Long petId); public Pet getPetById(@PathParam("petId") Long petId);
/**
* Update an existing pet
*
*
*
*/
@PUT @PUT
@Path("/pet") @Path("/pet")
@Consumes({ "application/json", "application/xml" }) @Consumes({ "application/json", "application/xml" })
@ -81,6 +123,12 @@ public interface PetApi {
@ApiResponse(code = 405, message = "Validation exception") }) @ApiResponse(code = 405, message = "Validation exception") })
public void updatePet(@Valid Pet body); public void updatePet(@Valid Pet body);
/**
* Updates a pet in the store with form data
*
*
*
*/
@POST @POST
@Path("/pet/{petId}") @Path("/pet/{petId}")
@Consumes({ "application/x-www-form-urlencoded" }) @Consumes({ "application/x-www-form-urlencoded" })
@ -90,6 +138,12 @@ public interface PetApi {
@ApiResponse(code = 405, message = "Invalid input") }) @ApiResponse(code = 405, message = "Invalid input") })
public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status);
/**
* uploads an image
*
*
*
*/
@POST @POST
@Path("/pet/{petId}/uploadImage") @Path("/pet/{petId}/uploadImage")
@Consumes({ "multipart/form-data" }) @Consumes({ "multipart/form-data" })

View File

@ -20,10 +20,22 @@ import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
/**
* Swagger Petstore
*
* <p>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
@Path("/") @Path("/")
@Api(value = "/", description = "") @Api(value = "/", description = "")
public interface StoreApi { public interface StoreApi {
/**
* Delete purchase order by ID
*
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
*
*/
@DELETE @DELETE
@Path("/store/order/{orderId}") @Path("/store/order/{orderId}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -33,6 +45,12 @@ public interface StoreApi {
@ApiResponse(code = 404, message = "Order not found") }) @ApiResponse(code = 404, message = "Order not found") })
public void deleteOrder(@PathParam("orderId") String orderId); public void deleteOrder(@PathParam("orderId") String orderId);
/**
* Returns pet inventories by status
*
* Returns a map of status codes to quantities
*
*/
@GET @GET
@Path("/store/inventory") @Path("/store/inventory")
@Produces({ "application/json" }) @Produces({ "application/json" })
@ -41,6 +59,12 @@ public interface StoreApi {
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") })
public Map<String, Integer> getInventory(); public Map<String, Integer> getInventory();
/**
* Find purchase order by ID
*
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
*
*/
@GET @GET
@Path("/store/order/{orderId}") @Path("/store/order/{orderId}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -51,6 +75,12 @@ public interface StoreApi {
@ApiResponse(code = 404, message = "Order not found") }) @ApiResponse(code = 404, message = "Order not found") })
public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId); public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId);
/**
* Place an order for a pet
*
*
*
*/
@POST @POST
@Path("/store/order") @Path("/store/order")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })

View File

@ -20,10 +20,22 @@ import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
/**
* Swagger Petstore
*
* <p>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
@Path("/") @Path("/")
@Api(value = "/", description = "") @Api(value = "/", description = "")
public interface UserApi { public interface UserApi {
/**
* Create user
*
* This can only be done by the logged in user.
*
*/
@POST @POST
@Path("/user") @Path("/user")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -32,6 +44,12 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") }) @ApiResponse(code = 200, message = "successful operation") })
public void createUser(@Valid User body); public void createUser(@Valid User body);
/**
* Creates list of users with given input array
*
*
*
*/
@POST @POST
@Path("/user/createWithArray") @Path("/user/createWithArray")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -40,6 +58,12 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") }) @ApiResponse(code = 200, message = "successful operation") })
public void createUsersWithArrayInput(@Valid List<User> body); public void createUsersWithArrayInput(@Valid List<User> body);
/**
* Creates list of users with given input array
*
*
*
*/
@POST @POST
@Path("/user/createWithList") @Path("/user/createWithList")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -48,6 +72,12 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") }) @ApiResponse(code = 200, message = "successful operation") })
public void createUsersWithListInput(@Valid List<User> body); public void createUsersWithListInput(@Valid List<User> body);
/**
* Delete user
*
* This can only be done by the logged in user.
*
*/
@DELETE @DELETE
@Path("/user/{username}") @Path("/user/{username}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -57,6 +87,12 @@ public interface UserApi {
@ApiResponse(code = 404, message = "User not found") }) @ApiResponse(code = 404, message = "User not found") })
public void deleteUser(@PathParam("username") String username); public void deleteUser(@PathParam("username") String username);
/**
* Get user by user name
*
*
*
*/
@GET @GET
@Path("/user/{username}") @Path("/user/{username}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -67,6 +103,12 @@ public interface UserApi {
@ApiResponse(code = 404, message = "User not found") }) @ApiResponse(code = 404, message = "User not found") })
public User getUserByName(@PathParam("username") String username); public User getUserByName(@PathParam("username") String username);
/**
* Logs user into the system
*
*
*
*/
@GET @GET
@Path("/user/login") @Path("/user/login")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -76,6 +118,12 @@ public interface UserApi {
@ApiResponse(code = 400, message = "Invalid username/password supplied") }) @ApiResponse(code = 400, message = "Invalid username/password supplied") })
public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password);
/**
* Logs out current logged in user session
*
*
*
*/
@GET @GET
@Path("/user/logout") @Path("/user/logout")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -84,6 +132,12 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") }) @ApiResponse(code = 200, message = "successful operation") })
public void logoutUser(); public void logoutUser();
/**
* Updated user
*
* This can only be done by the logged in user.
*
*/
@PUT @PUT
@Path("/user/{username}") @Path("/user/{username}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })

View File

@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A category for a pet
**/
@ApiModel(description="A category for a pet") @ApiModel(description="A category for a pet")
public class Category { public class Category {

View File

@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Describes the result of uploading an image resource
**/
@ApiModel(description="Describes the result of uploading an image resource") @ApiModel(description="Describes the result of uploading an image resource")
public class ModelApiResponse { public class ModelApiResponse {

View File

@ -14,6 +14,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* An order for a pets from the pet store
**/
@ApiModel(description="An order for a pets from the pet store") @ApiModel(description="An order for a pets from the pet store")
public class Order { public class Order {
@ -59,6 +62,9 @@ public enum StatusEnum {
} }
@ApiModelProperty(value = "Order Status") @ApiModelProperty(value = "Order Status")
/**
* Order Status
**/
private StatusEnum status = null; private StatusEnum status = null;
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
private Boolean complete = false; private Boolean complete = false;

View File

@ -17,6 +17,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A pet for sale in the pet store
**/
@ApiModel(description="A pet for sale in the pet store") @ApiModel(description="A pet for sale in the pet store")
public class Pet { public class Pet {
@ -64,6 +67,9 @@ public enum StatusEnum {
} }
@ApiModelProperty(value = "pet status in the store") @ApiModelProperty(value = "pet status in the store")
/**
* pet status in the store
**/
private StatusEnum status = null; private StatusEnum status = null;
/** /**

View File

@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A tag for a pet
**/
@ApiModel(description="A tag for a pet") @ApiModel(description="A tag for a pet")
public class Tag { public class Tag {

View File

@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A User who is purchasing from the pet store
**/
@ApiModel(description="A User who is purchasing from the pet store") @ApiModel(description="A User who is purchasing from the pet store")
public class User { public class User {
@ -31,6 +34,9 @@ public class User {
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
private String phone = null; private String phone = null;
@ApiModelProperty(value = "User Status") @ApiModelProperty(value = "User Status")
/**
* User Status
**/
private Integer userStatus = null; private Integer userStatus = null;
/** /**

View File

@ -18,49 +18,103 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
/**
* Swagger Petstore
*
* <p>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
public class PetApiServiceImpl implements PetApi { public class PetApiServiceImpl implements PetApi {
/**
* Add a new pet to the store
*
*
*
*/
public void addPet(Pet body) { public void addPet(Pet body) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Deletes a pet
*
*
*
*/
public void deletePet(Long petId, String apiKey) { public void deletePet(Long petId, String apiKey) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Finds Pets by status
*
* Multiple status values can be provided with comma separated strings
*
*/
public List<Pet> findPetsByStatus(List<String> status) { public List<Pet> findPetsByStatus(List<String> status) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Finds Pets by tags
*
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
*
*/
public List<Pet> findPetsByTags(List<String> tags) { public List<Pet> findPetsByTags(List<String> tags) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Find pet by ID
*
* Returns a single pet
*
*/
public Pet getPetById(Long petId) { public Pet getPetById(Long petId) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Update an existing pet
*
*
*
*/
public void updatePet(Pet body) { public void updatePet(Pet body) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Updates a pet in the store with form data
*
*
*
*/
public void updatePetWithForm(Long petId, String name, String status) { public void updatePetWithForm(Long petId, String name, String status) {
// TODO: Implement... // TODO: Implement...
} }
/**
* uploads an image
*
*
*
*/
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Attachment fileDetail) { public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Attachment fileDetail) {
// TODO: Implement... // TODO: Implement...

View File

@ -17,25 +17,55 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
/**
* Swagger Petstore
*
* <p>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
public class StoreApiServiceImpl implements StoreApi { public class StoreApiServiceImpl implements StoreApi {
/**
* Delete purchase order by ID
*
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
*
*/
public void deleteOrder(String orderId) { public void deleteOrder(String orderId) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Returns pet inventories by status
*
* Returns a map of status codes to quantities
*
*/
public Map<String, Integer> getInventory() { public Map<String, Integer> getInventory() {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Find purchase order by ID
*
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
*
*/
public Order getOrderById(Long orderId) { public Order getOrderById(Long orderId) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Place an order for a pet
*
*
*
*/
public Order placeOrder(Order body) { public Order placeOrder(Order body) {
// TODO: Implement... // TODO: Implement...

View File

@ -17,49 +17,103 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
/**
* Swagger Petstore
*
* <p>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
public class UserApiServiceImpl implements UserApi { public class UserApiServiceImpl implements UserApi {
/**
* Create user
*
* This can only be done by the logged in user.
*
*/
public void createUser(User body) { public void createUser(User body) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Creates list of users with given input array
*
*
*
*/
public void createUsersWithArrayInput(List<User> body) { public void createUsersWithArrayInput(List<User> body) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Creates list of users with given input array
*
*
*
*/
public void createUsersWithListInput(List<User> body) { public void createUsersWithListInput(List<User> body) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Delete user
*
* This can only be done by the logged in user.
*
*/
public void deleteUser(String username) { public void deleteUser(String username) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Get user by user name
*
*
*
*/
public User getUserByName(String username) { public User getUserByName(String username) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Logs user into the system
*
*
*
*/
public String loginUser(String username, String password) { public String loginUser(String username, String password) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Logs out current logged in user session
*
*
*
*/
public void logoutUser() { public void logoutUser() {
// TODO: Implement... // TODO: Implement...
} }
/**
* Updated user
*
* This can only be done by the logged in user.
*
*/
public void updateUser(String username, User body) { public void updateUser(String username, User body) {
// TODO: Implement... // TODO: Implement...

View File

@ -4,6 +4,7 @@
<artifactId>swagger-cxf-server</artifactId> <artifactId>swagger-cxf-server</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<name>swagger-cxf-server</name> <name>swagger-cxf-server</name>
<description>This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \&quot; \\</description>
<version>1.0.0</version> <version>1.0.0</version>
<build> <build>
<sourceDirectory>src/main/java</sourceDirectory> <sourceDirectory>src/main/java</sourceDirectory>
@ -32,7 +33,7 @@
<stopPort>8079</stopPort> <stopPort>8079</stopPort>
<stopKey>stopit</stopKey> <stopKey>stopit</stopKey>
<httpConnector> <httpConnector>
<port>8080</port> <port>80</port>
<idleTimeout>60000</idleTimeout> <idleTimeout>60000</idleTimeout>
</httpConnector> </httpConnector>
</configuration> </configuration>

View File

@ -19,10 +19,22 @@ import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
/**
* Swagger Petstore
*
* <p>This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
*/
@Path("/") @Path("/")
@Api(value = "/", description = "") @Api(value = "/", description = "")
public interface AnotherFakeApi { public interface AnotherFakeApi {
/**
* To test special tags
*
* To test special tags
*
*/
@PATCH @PATCH
@Path("/another-fake/dummy") @Path("/another-fake/dummy")
@Consumes({ "application/json" }) @Consumes({ "application/json" })

View File

@ -23,6 +23,12 @@ import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
/**
* Swagger Petstore
*
* <p>This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
*/
@Path("/") @Path("/")
@Api(value = "/", description = "") @Api(value = "/", description = "")
public interface FakeApi { public interface FakeApi {
@ -55,6 +61,12 @@ public interface FakeApi {
@ApiResponse(code = 200, message = "Output string", response = String.class) }) @ApiResponse(code = 200, message = "Output string", response = String.class) })
public String fakeOuterStringSerialize(@Valid String body); public String fakeOuterStringSerialize(@Valid String body);
/**
* To test \&quot;client\&quot; model
*
* To test \&quot;client\&quot; model
*
*/
@PATCH @PATCH
@Path("/fake") @Path("/fake")
@Consumes({ "application/json" }) @Consumes({ "application/json" })
@ -64,6 +76,12 @@ public interface FakeApi {
@ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @ApiResponse(code = 200, message = "successful operation", response = Client.class) })
public Client testClientModel(@Valid Client body); public Client testClientModel(@Valid Client body);
/**
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*
*/
@POST @POST
@Path("/fake") @Path("/fake")
@Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" })
@ -74,6 +92,12 @@ public interface FakeApi {
@ApiResponse(code = 404, message = "User not found") }) @ApiResponse(code = 404, message = "User not found") })
public void testEndpointParameters(@Multipart(value = "number") BigDecimal number, @Multipart(value = "double") Double _double, @Multipart(value = "pattern_without_delimiter") String patternWithoutDelimiter, @Multipart(value = "byte") byte[] _byte, @Multipart(value = "integer", required = false) Integer integer, @Multipart(value = "int32", required = false) Integer int32, @Multipart(value = "int64", required = false) Long int64, @Multipart(value = "float", required = false) Float _float, @Multipart(value = "string", required = false) String string, @Multipart(value = "binary", required = false) byte[] binary, @Multipart(value = "date", required = false) LocalDate date, @Multipart(value = "dateTime", required = false) Date dateTime, @Multipart(value = "password", required = false) String password, @Multipart(value = "callback", required = false) String paramCallback); public void testEndpointParameters(@Multipart(value = "number") BigDecimal number, @Multipart(value = "double") Double _double, @Multipart(value = "pattern_without_delimiter") String patternWithoutDelimiter, @Multipart(value = "byte") byte[] _byte, @Multipart(value = "integer", required = false) Integer integer, @Multipart(value = "int32", required = false) Integer int32, @Multipart(value = "int64", required = false) Long int64, @Multipart(value = "float", required = false) Float _float, @Multipart(value = "string", required = false) String string, @Multipart(value = "binary", required = false) byte[] binary, @Multipart(value = "date", required = false) LocalDate date, @Multipart(value = "dateTime", required = false) Date dateTime, @Multipart(value = "password", required = false) String password, @Multipart(value = "callback", required = false) String paramCallback);
/**
* To test enum parameters
*
* To test enum parameters
*
*/
@GET @GET
@Path("/fake") @Path("/fake")
@Consumes({ "*/*" }) @Consumes({ "*/*" })
@ -84,6 +108,12 @@ public interface FakeApi {
@ApiResponse(code = 404, message = "Not found") }) @ApiResponse(code = 404, message = "Not found") })
public void testEnumParameters(@Multipart(value = "enum_form_string_array", required = false) List<String> enumFormStringArray, @Multipart(value = "enum_form_string", required = false) String enumFormString, @HeaderParam("enum_header_string_array") List<String> enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List<String> enumQueryStringArray, @QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @Multipart(value = "enum_query_double", required = false) Double enumQueryDouble); public void testEnumParameters(@Multipart(value = "enum_form_string_array", required = false) List<String> enumFormStringArray, @Multipart(value = "enum_form_string", required = false) String enumFormString, @HeaderParam("enum_header_string_array") List<String> enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List<String> enumQueryStringArray, @QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @Multipart(value = "enum_query_double", required = false) Double enumQueryDouble);
/**
* test json serialization of form data
*
*
*
*/
@GET @GET
@Path("/fake/jsonFormData") @Path("/fake/jsonFormData")
@Consumes({ "application/json" }) @Consumes({ "application/json" })

View File

@ -19,10 +19,20 @@ import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
/**
* Swagger Petstore
*
* <p>This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
*/
@Path("/") @Path("/")
@Api(value = "/", description = "") @Api(value = "/", description = "")
public interface FakeClassnameTags123Api { public interface FakeClassnameTags123Api {
/**
* To test class name in snake case
*
*/
@PATCH @PATCH
@Path("/fake_classname_test") @Path("/fake_classname_test")
@Consumes({ "application/json" }) @Consumes({ "application/json" })

View File

@ -21,10 +21,22 @@ import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
/**
* Swagger Petstore
*
* <p>This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
*/
@Path("/") @Path("/")
@Api(value = "/", description = "") @Api(value = "/", description = "")
public interface PetApi { public interface PetApi {
/**
* Add a new pet to the store
*
*
*
*/
@POST @POST
@Path("/pet") @Path("/pet")
@Consumes({ "application/json", "application/xml" }) @Consumes({ "application/json", "application/xml" })
@ -34,6 +46,12 @@ public interface PetApi {
@ApiResponse(code = 405, message = "Invalid input") }) @ApiResponse(code = 405, message = "Invalid input") })
public void addPet(@Valid Pet body); public void addPet(@Valid Pet body);
/**
* Deletes a pet
*
*
*
*/
@DELETE @DELETE
@Path("/pet/{petId}") @Path("/pet/{petId}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -42,6 +60,12 @@ public interface PetApi {
@ApiResponse(code = 400, message = "Invalid pet value") }) @ApiResponse(code = 400, message = "Invalid pet value") })
public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey);
/**
* Finds Pets by status
*
* Multiple status values can be provided with comma separated strings
*
*/
@GET @GET
@Path("/pet/findByStatus") @Path("/pet/findByStatus")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -51,6 +75,12 @@ public interface PetApi {
@ApiResponse(code = 400, message = "Invalid status value") }) @ApiResponse(code = 400, message = "Invalid status value") })
public List<Pet> findPetsByStatus(@QueryParam("status") @NotNull List<String> status); public List<Pet> findPetsByStatus(@QueryParam("status") @NotNull List<String> status);
/**
* Finds Pets by tags
*
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
*
*/
@GET @GET
@Path("/pet/findByTags") @Path("/pet/findByTags")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -60,6 +90,12 @@ public interface PetApi {
@ApiResponse(code = 400, message = "Invalid tag value") }) @ApiResponse(code = 400, message = "Invalid tag value") })
public List<Pet> findPetsByTags(@QueryParam("tags") @NotNull List<String> tags); public List<Pet> findPetsByTags(@QueryParam("tags") @NotNull List<String> tags);
/**
* Find pet by ID
*
* Returns a single pet
*
*/
@GET @GET
@Path("/pet/{petId}") @Path("/pet/{petId}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -70,6 +106,12 @@ public interface PetApi {
@ApiResponse(code = 404, message = "Pet not found") }) @ApiResponse(code = 404, message = "Pet not found") })
public Pet getPetById(@PathParam("petId") Long petId); public Pet getPetById(@PathParam("petId") Long petId);
/**
* Update an existing pet
*
*
*
*/
@PUT @PUT
@Path("/pet") @Path("/pet")
@Consumes({ "application/json", "application/xml" }) @Consumes({ "application/json", "application/xml" })
@ -81,6 +123,12 @@ public interface PetApi {
@ApiResponse(code = 405, message = "Validation exception") }) @ApiResponse(code = 405, message = "Validation exception") })
public void updatePet(@Valid Pet body); public void updatePet(@Valid Pet body);
/**
* Updates a pet in the store with form data
*
*
*
*/
@POST @POST
@Path("/pet/{petId}") @Path("/pet/{petId}")
@Consumes({ "application/x-www-form-urlencoded" }) @Consumes({ "application/x-www-form-urlencoded" })
@ -90,6 +138,12 @@ public interface PetApi {
@ApiResponse(code = 405, message = "Invalid input") }) @ApiResponse(code = 405, message = "Invalid input") })
public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status);
/**
* uploads an image
*
*
*
*/
@POST @POST
@Path("/pet/{petId}/uploadImage") @Path("/pet/{petId}/uploadImage")
@Consumes({ "multipart/form-data" }) @Consumes({ "multipart/form-data" })

View File

@ -20,10 +20,22 @@ import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
/**
* Swagger Petstore
*
* <p>This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
*/
@Path("/") @Path("/")
@Api(value = "/", description = "") @Api(value = "/", description = "")
public interface StoreApi { public interface StoreApi {
/**
* Delete purchase order by ID
*
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
*
*/
@DELETE @DELETE
@Path("/store/order/{order_id}") @Path("/store/order/{order_id}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -33,6 +45,12 @@ public interface StoreApi {
@ApiResponse(code = 404, message = "Order not found") }) @ApiResponse(code = 404, message = "Order not found") })
public void deleteOrder(@PathParam("order_id") String orderId); public void deleteOrder(@PathParam("order_id") String orderId);
/**
* Returns pet inventories by status
*
* Returns a map of status codes to quantities
*
*/
@GET @GET
@Path("/store/inventory") @Path("/store/inventory")
@Produces({ "application/json" }) @Produces({ "application/json" })
@ -41,6 +59,12 @@ public interface StoreApi {
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") })
public Map<String, Integer> getInventory(); public Map<String, Integer> getInventory();
/**
* Find purchase order by ID
*
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
*
*/
@GET @GET
@Path("/store/order/{order_id}") @Path("/store/order/{order_id}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -51,6 +75,12 @@ public interface StoreApi {
@ApiResponse(code = 404, message = "Order not found") }) @ApiResponse(code = 404, message = "Order not found") })
public Order getOrderById(@PathParam("order_id") @Min(1) @Max(5) Long orderId); public Order getOrderById(@PathParam("order_id") @Min(1) @Max(5) Long orderId);
/**
* Place an order for a pet
*
*
*
*/
@POST @POST
@Path("/store/order") @Path("/store/order")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })

View File

@ -20,10 +20,22 @@ import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
/**
* Swagger Petstore
*
* <p>This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
*/
@Path("/") @Path("/")
@Api(value = "/", description = "") @Api(value = "/", description = "")
public interface UserApi { public interface UserApi {
/**
* Create user
*
* This can only be done by the logged in user.
*
*/
@POST @POST
@Path("/user") @Path("/user")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -32,6 +44,12 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") }) @ApiResponse(code = 200, message = "successful operation") })
public void createUser(@Valid User body); public void createUser(@Valid User body);
/**
* Creates list of users with given input array
*
*
*
*/
@POST @POST
@Path("/user/createWithArray") @Path("/user/createWithArray")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -40,6 +58,12 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") }) @ApiResponse(code = 200, message = "successful operation") })
public void createUsersWithArrayInput(@Valid List<User> body); public void createUsersWithArrayInput(@Valid List<User> body);
/**
* Creates list of users with given input array
*
*
*
*/
@POST @POST
@Path("/user/createWithList") @Path("/user/createWithList")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -48,6 +72,12 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") }) @ApiResponse(code = 200, message = "successful operation") })
public void createUsersWithListInput(@Valid List<User> body); public void createUsersWithListInput(@Valid List<User> body);
/**
* Delete user
*
* This can only be done by the logged in user.
*
*/
@DELETE @DELETE
@Path("/user/{username}") @Path("/user/{username}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -57,6 +87,12 @@ public interface UserApi {
@ApiResponse(code = 404, message = "User not found") }) @ApiResponse(code = 404, message = "User not found") })
public void deleteUser(@PathParam("username") String username); public void deleteUser(@PathParam("username") String username);
/**
* Get user by user name
*
*
*
*/
@GET @GET
@Path("/user/{username}") @Path("/user/{username}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -67,6 +103,12 @@ public interface UserApi {
@ApiResponse(code = 404, message = "User not found") }) @ApiResponse(code = 404, message = "User not found") })
public User getUserByName(@PathParam("username") String username); public User getUserByName(@PathParam("username") String username);
/**
* Logs user into the system
*
*
*
*/
@GET @GET
@Path("/user/login") @Path("/user/login")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -76,6 +118,12 @@ public interface UserApi {
@ApiResponse(code = 400, message = "Invalid username/password supplied") }) @ApiResponse(code = 400, message = "Invalid username/password supplied") })
public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password);
/**
* Logs out current logged in user session
*
*
*
*/
@GET @GET
@Path("/user/logout") @Path("/user/logout")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ -84,6 +132,12 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") }) @ApiResponse(code = 200, message = "successful operation") })
public void logoutUser(); public void logoutUser();
/**
* Updated user
*
* This can only be done by the logged in user.
*
*/
@PUT @PUT
@Path("/user/{username}") @Path("/user/{username}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })

View File

@ -25,6 +25,9 @@ public class Capitalization {
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
private String scAETHFlowPoints = null; private String scAETHFlowPoints = null;
@ApiModelProperty(value = "Name of the pet ") @ApiModelProperty(value = "Name of the pet ")
/**
* Name of the pet
**/
private String ATT_NAME = null; private String ATT_NAME = null;
/** /**

View File

@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Model for testing model with \"_class\" property
**/
@ApiModel(description="Model for testing model with \"_class\" property") @ApiModel(description="Model for testing model with \"_class\" property")
public class ClassModel { public class ClassModel {

View File

@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Model for testing model name starting with number
**/
@ApiModel(description="Model for testing model name starting with number") @ApiModel(description="Model for testing model name starting with number")
public class Model200Response { public class Model200Response {

View File

@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Model for testing reserved words
**/
@ApiModel(description="Model for testing reserved words") @ApiModel(description="Model for testing reserved words")
public class ModelReturn { public class ModelReturn {

View File

@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlEnumValue;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Model for testing model name same as property name
**/
@ApiModel(description="Model for testing model name same as property name") @ApiModel(description="Model for testing model name same as property name")
public class Name { public class Name {

View File

@ -57,6 +57,9 @@ public enum StatusEnum {
} }
@ApiModelProperty(value = "Order Status") @ApiModelProperty(value = "Order Status")
/**
* Order Status
**/
private StatusEnum status = null; private StatusEnum status = null;
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
private Boolean complete = false; private Boolean complete = false;

View File

@ -62,6 +62,9 @@ public enum StatusEnum {
} }
@ApiModelProperty(value = "pet status in the store") @ApiModelProperty(value = "pet status in the store")
/**
* pet status in the store
**/
private StatusEnum status = null; private StatusEnum status = null;
/** /**

View File

@ -29,6 +29,9 @@ public class User {
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
private String phone = null; private String phone = null;
@ApiModelProperty(value = "User Status") @ApiModelProperty(value = "User Status")
/**
* User Status
**/
private Integer userStatus = null; private Integer userStatus = null;
/** /**

View File

@ -16,7 +16,19 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
/**
* Swagger Petstore
*
* <p>This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
*/
public class AnotherFakeApiServiceImpl implements AnotherFakeApi { public class AnotherFakeApiServiceImpl implements AnotherFakeApi {
/**
* To test special tags
*
* To test special tags
*
*/
public Client testSpecialTags(Client body) { public Client testSpecialTags(Client body) {
// TODO: Implement... // TODO: Implement...

View File

@ -20,6 +20,12 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
/**
* Swagger Petstore
*
* <p>This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
*/
public class FakeApiServiceImpl implements FakeApi { public class FakeApiServiceImpl implements FakeApi {
public Boolean fakeOuterBooleanSerialize(Boolean body) { public Boolean fakeOuterBooleanSerialize(Boolean body) {
// TODO: Implement... // TODO: Implement...
@ -45,24 +51,48 @@ public class FakeApiServiceImpl implements FakeApi {
return null; return null;
} }
/**
* To test \&quot;client\&quot; model
*
* To test \&quot;client\&quot; model
*
*/
public Client testClientModel(Client body) { public Client testClientModel(Client body) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*
*/
public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, Date dateTime, String password, String paramCallback) { public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, Date dateTime, String password, String paramCallback) {
// TODO: Implement... // TODO: Implement...
} }
/**
* To test enum parameters
*
* To test enum parameters
*
*/
public void testEnumParameters(List<String> enumFormStringArray, String enumFormString, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) { public void testEnumParameters(List<String> enumFormStringArray, String enumFormString, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) {
// TODO: Implement... // TODO: Implement...
} }
/**
* test json serialization of form data
*
*
*
*/
public void testJsonFormData(String param, String param2) { public void testJsonFormData(String param, String param2) {
// TODO: Implement... // TODO: Implement...

View File

@ -16,7 +16,17 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
/**
* Swagger Petstore
*
* <p>This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
*/
public class FakeClassnameTags123ApiServiceImpl implements FakeClassnameTags123Api { public class FakeClassnameTags123ApiServiceImpl implements FakeClassnameTags123Api {
/**
* To test class name in snake case
*
*/
public Client testClassname(Client body) { public Client testClassname(Client body) {
// TODO: Implement... // TODO: Implement...

View File

@ -18,49 +18,103 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
/**
* Swagger Petstore
*
* <p>This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
*/
public class PetApiServiceImpl implements PetApi { public class PetApiServiceImpl implements PetApi {
/**
* Add a new pet to the store
*
*
*
*/
public void addPet(Pet body) { public void addPet(Pet body) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Deletes a pet
*
*
*
*/
public void deletePet(Long petId, String apiKey) { public void deletePet(Long petId, String apiKey) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Finds Pets by status
*
* Multiple status values can be provided with comma separated strings
*
*/
public List<Pet> findPetsByStatus(List<String> status) { public List<Pet> findPetsByStatus(List<String> status) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Finds Pets by tags
*
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
*
*/
public List<Pet> findPetsByTags(List<String> tags) { public List<Pet> findPetsByTags(List<String> tags) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Find pet by ID
*
* Returns a single pet
*
*/
public Pet getPetById(Long petId) { public Pet getPetById(Long petId) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Update an existing pet
*
*
*
*/
public void updatePet(Pet body) { public void updatePet(Pet body) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Updates a pet in the store with form data
*
*
*
*/
public void updatePetWithForm(Long petId, String name, String status) { public void updatePetWithForm(Long petId, String name, String status) {
// TODO: Implement... // TODO: Implement...
} }
/**
* uploads an image
*
*
*
*/
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Attachment fileDetail) { public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Attachment fileDetail) {
// TODO: Implement... // TODO: Implement...

View File

@ -17,25 +17,55 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
/**
* Swagger Petstore
*
* <p>This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
*/
public class StoreApiServiceImpl implements StoreApi { public class StoreApiServiceImpl implements StoreApi {
/**
* Delete purchase order by ID
*
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
*
*/
public void deleteOrder(String orderId) { public void deleteOrder(String orderId) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Returns pet inventories by status
*
* Returns a map of status codes to quantities
*
*/
public Map<String, Integer> getInventory() { public Map<String, Integer> getInventory() {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Find purchase order by ID
*
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
*
*/
public Order getOrderById(Long orderId) { public Order getOrderById(Long orderId) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Place an order for a pet
*
*
*
*/
public Order placeOrder(Order body) { public Order placeOrder(Order body) {
// TODO: Implement... // TODO: Implement...

View File

@ -17,49 +17,103 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
/**
* Swagger Petstore
*
* <p>This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
*/
public class UserApiServiceImpl implements UserApi { public class UserApiServiceImpl implements UserApi {
/**
* Create user
*
* This can only be done by the logged in user.
*
*/
public void createUser(User body) { public void createUser(User body) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Creates list of users with given input array
*
*
*
*/
public void createUsersWithArrayInput(List<User> body) { public void createUsersWithArrayInput(List<User> body) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Creates list of users with given input array
*
*
*
*/
public void createUsersWithListInput(List<User> body) { public void createUsersWithListInput(List<User> body) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Delete user
*
* This can only be done by the logged in user.
*
*/
public void deleteUser(String username) { public void deleteUser(String username) {
// TODO: Implement... // TODO: Implement...
} }
/**
* Get user by user name
*
*
*
*/
public User getUserByName(String username) { public User getUserByName(String username) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Logs user into the system
*
*
*
*/
public String loginUser(String username, String password) { public String loginUser(String username, String password) {
// TODO: Implement... // TODO: Implement...
return null; return null;
} }
/**
* Logs out current logged in user session
*
*
*
*/
public void logoutUser() { public void logoutUser() {
// TODO: Implement... // TODO: Implement...
} }
/**
* Updated user
*
* This can only be done by the logged in user.
*
*/
public void updateUser(String username, User body) { public void updateUser(String username, User body) {
// TODO: Implement... // TODO: Implement...