This commit is contained in:
Tony Tam 2017-03-01 09:57:38 -05:00
parent af2749325d
commit 2cec6192a4
9 changed files with 224 additions and 11 deletions

View File

@ -15,6 +15,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*;
@Path("/v2") @Path("/v2")
@Api(value = "/", description = "") @Api(value = "/", description = "")
@ -37,13 +39,13 @@ public interface PetApi {
@Path("/pet/findByStatus") @Path("/pet/findByStatus")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Finds Pets by status", tags={ "pet", }) @ApiOperation(value = "Finds Pets by status", tags={ "pet", })
public List<Pet> findPetsByStatus(@QueryParam("status")List<String> status); public List<Pet> findPetsByStatus(@QueryParam("status") @NotNull List<String> status);
@GET @GET
@Path("/pet/findByTags") @Path("/pet/findByTags")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Finds Pets by tags", tags={ "pet", }) @ApiOperation(value = "Finds Pets by tags", tags={ "pet", })
public List<Pet> findPetsByTags(@QueryParam("tags")List<String> tags); public List<Pet> findPetsByTags(@QueryParam("tags") @NotNull List<String> tags);
@GET @GET
@Path("/pet/{petId}") @Path("/pet/{petId}")

View File

@ -14,6 +14,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*;
@Path("/v2") @Path("/v2")
@Api(value = "/", description = "") @Api(value = "/", description = "")

View File

@ -14,6 +14,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*;
@Path("/v2") @Path("/v2")
@Api(value = "/", description = "") @Api(value = "/", description = "")
@ -53,7 +55,7 @@ public interface UserApi {
@Path("/user/login") @Path("/user/login")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Logs user into the system", tags={ "user", }) @ApiOperation(value = "Logs user into the system", tags={ "user", })
public String loginUser(@QueryParam("username")String username, @QueryParam("password")String password); public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password);
@GET @GET
@Path("/user/logout") @Path("/user/logout")

View File

@ -1,6 +1,7 @@
package io.swagger.model; package io.swagger.model;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import javax.validation.constraints.*;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
@ -26,9 +27,16 @@ public class Category {
public Long getId() { public Long getId() {
return id; return id;
} }
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
public Category id(Long id) {
this.id = id;
return this;
}
/** /**
* Get name * Get name
* @return name * @return name
@ -36,10 +44,17 @@ public class Category {
public String getName() { public String getName() {
return name; return name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public Category name(String name) {
this.name = name;
return this;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -55,7 +70,7 @@ public class Category {
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*/ */
private static String toIndentedString(Object o) { private static String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -1,6 +1,7 @@
package io.swagger.model; package io.swagger.model;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import javax.validation.constraints.*;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
@ -28,9 +29,16 @@ public class ModelApiResponse {
public Integer getCode() { public Integer getCode() {
return code; return code;
} }
public void setCode(Integer code) { public void setCode(Integer code) {
this.code = code; this.code = code;
} }
public ModelApiResponse code(Integer code) {
this.code = code;
return this;
}
/** /**
* Get type * Get type
* @return type * @return type
@ -38,9 +46,16 @@ public class ModelApiResponse {
public String getType() { public String getType() {
return type; return type;
} }
public void setType(String type) { public void setType(String type) {
this.type = type; this.type = type;
} }
public ModelApiResponse type(String type) {
this.type = type;
return this;
}
/** /**
* Get message * Get message
* @return message * @return message
@ -48,10 +63,17 @@ public class ModelApiResponse {
public String getMessage() { public String getMessage() {
return message; return message;
} }
public void setMessage(String message) { public void setMessage(String message) {
this.message = message; this.message = message;
} }
public ModelApiResponse message(String message) {
this.message = message;
return this;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -68,7 +90,7 @@ public class ModelApiResponse {
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*/ */
private static String toIndentedString(Object o) { private static String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -1,6 +1,7 @@
package io.swagger.model; package io.swagger.model;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import javax.validation.constraints.*;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
@ -67,9 +68,16 @@ public enum StatusEnum {
public Long getId() { public Long getId() {
return id; return id;
} }
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
public Order id(Long id) {
this.id = id;
return this;
}
/** /**
* Get petId * Get petId
* @return petId * @return petId
@ -77,9 +85,16 @@ public enum StatusEnum {
public Long getPetId() { public Long getPetId() {
return petId; return petId;
} }
public void setPetId(Long petId) { public void setPetId(Long petId) {
this.petId = petId; this.petId = petId;
} }
public Order petId(Long petId) {
this.petId = petId;
return this;
}
/** /**
* Get quantity * Get quantity
* @return quantity * @return quantity
@ -87,9 +102,16 @@ public enum StatusEnum {
public Integer getQuantity() { public Integer getQuantity() {
return quantity; return quantity;
} }
public void setQuantity(Integer quantity) { public void setQuantity(Integer quantity) {
this.quantity = quantity; this.quantity = quantity;
} }
public Order quantity(Integer quantity) {
this.quantity = quantity;
return this;
}
/** /**
* Get shipDate * Get shipDate
* @return shipDate * @return shipDate
@ -97,9 +119,16 @@ public enum StatusEnum {
public javax.xml.datatype.XMLGregorianCalendar getShipDate() { public javax.xml.datatype.XMLGregorianCalendar getShipDate() {
return shipDate; return shipDate;
} }
public void setShipDate(javax.xml.datatype.XMLGregorianCalendar shipDate) { public void setShipDate(javax.xml.datatype.XMLGregorianCalendar shipDate) {
this.shipDate = shipDate; this.shipDate = shipDate;
} }
public Order shipDate(javax.xml.datatype.XMLGregorianCalendar shipDate) {
this.shipDate = shipDate;
return this;
}
/** /**
* Order Status * Order Status
* @return status * @return status
@ -107,9 +136,16 @@ public enum StatusEnum {
public StatusEnum getStatus() { public StatusEnum getStatus() {
return status; return status;
} }
public void setStatus(StatusEnum status) { public void setStatus(StatusEnum status) {
this.status = status; this.status = status;
} }
public Order status(StatusEnum status) {
this.status = status;
return this;
}
/** /**
* Get complete * Get complete
* @return complete * @return complete
@ -117,10 +153,17 @@ public enum StatusEnum {
public Boolean getComplete() { public Boolean getComplete() {
return complete; return complete;
} }
public void setComplete(Boolean complete) { public void setComplete(Boolean complete) {
this.complete = complete; this.complete = complete;
} }
public Order complete(Boolean complete) {
this.complete = complete;
return this;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -140,7 +183,7 @@ public enum StatusEnum {
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*/ */
private static String toIndentedString(Object o) { private static String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -5,6 +5,7 @@ import io.swagger.model.Category;
import io.swagger.model.Tag; import io.swagger.model.Tag;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.validation.constraints.*;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
@ -71,9 +72,16 @@ public enum StatusEnum {
public Long getId() { public Long getId() {
return id; return id;
} }
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
public Pet id(Long id) {
this.id = id;
return this;
}
/** /**
* Get category * Get category
* @return category * @return category
@ -81,29 +89,57 @@ public enum StatusEnum {
public Category getCategory() { public Category getCategory() {
return category; return category;
} }
public void setCategory(Category category) { public void setCategory(Category category) {
this.category = category; this.category = category;
} }
public Pet category(Category category) {
this.category = category;
return this;
}
/** /**
* Get name * Get name
* @return name * @return name
**/ **/
@NotNull
public String getName() { public String getName() {
return name; return name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public Pet name(String name) {
this.name = name;
return this;
}
/** /**
* Get photoUrls * Get photoUrls
* @return photoUrls * @return photoUrls
**/ **/
@NotNull
public List<String> getPhotoUrls() { public List<String> getPhotoUrls() {
return photoUrls; return photoUrls;
} }
public void setPhotoUrls(List<String> photoUrls) { public void setPhotoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls; this.photoUrls = photoUrls;
} }
public Pet photoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
return this;
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
this.photoUrls.add(photoUrlsItem);
return this;
}
/** /**
* Get tags * Get tags
* @return tags * @return tags
@ -111,9 +147,21 @@ public enum StatusEnum {
public List<Tag> getTags() { public List<Tag> getTags() {
return tags; return tags;
} }
public void setTags(List<Tag> tags) { public void setTags(List<Tag> tags) {
this.tags = tags; this.tags = tags;
} }
public Pet tags(List<Tag> tags) {
this.tags = tags;
return this;
}
public Pet addTagsItem(Tag tagsItem) {
this.tags.add(tagsItem);
return this;
}
/** /**
* pet status in the store * pet status in the store
* @return status * @return status
@ -121,10 +169,17 @@ public enum StatusEnum {
public StatusEnum getStatus() { public StatusEnum getStatus() {
return status; return status;
} }
public void setStatus(StatusEnum status) { public void setStatus(StatusEnum status) {
this.status = status; this.status = status;
} }
public Pet status(StatusEnum status) {
this.status = status;
return this;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -144,7 +199,7 @@ public enum StatusEnum {
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*/ */
private static String toIndentedString(Object o) { private static String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -1,6 +1,7 @@
package io.swagger.model; package io.swagger.model;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import javax.validation.constraints.*;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
@ -26,9 +27,16 @@ public class Tag {
public Long getId() { public Long getId() {
return id; return id;
} }
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
public Tag id(Long id) {
this.id = id;
return this;
}
/** /**
* Get name * Get name
* @return name * @return name
@ -36,10 +44,17 @@ public class Tag {
public String getName() { public String getName() {
return name; return name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public Tag name(String name) {
this.name = name;
return this;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -55,7 +70,7 @@ public class Tag {
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*/ */
private static String toIndentedString(Object o) { private static String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -1,6 +1,7 @@
package io.swagger.model; package io.swagger.model;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import javax.validation.constraints.*;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
@ -38,9 +39,16 @@ public class User {
public Long getId() { public Long getId() {
return id; return id;
} }
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
public User id(Long id) {
this.id = id;
return this;
}
/** /**
* Get username * Get username
* @return username * @return username
@ -48,9 +56,16 @@ public class User {
public String getUsername() { public String getUsername() {
return username; return username;
} }
public void setUsername(String username) { public void setUsername(String username) {
this.username = username; this.username = username;
} }
public User username(String username) {
this.username = username;
return this;
}
/** /**
* Get firstName * Get firstName
* @return firstName * @return firstName
@ -58,9 +73,16 @@ public class User {
public String getFirstName() { public String getFirstName() {
return firstName; return firstName;
} }
public void setFirstName(String firstName) { public void setFirstName(String firstName) {
this.firstName = firstName; this.firstName = firstName;
} }
public User firstName(String firstName) {
this.firstName = firstName;
return this;
}
/** /**
* Get lastName * Get lastName
* @return lastName * @return lastName
@ -68,9 +90,16 @@ public class User {
public String getLastName() { public String getLastName() {
return lastName; return lastName;
} }
public void setLastName(String lastName) { public void setLastName(String lastName) {
this.lastName = lastName; this.lastName = lastName;
} }
public User lastName(String lastName) {
this.lastName = lastName;
return this;
}
/** /**
* Get email * Get email
* @return email * @return email
@ -78,9 +107,16 @@ public class User {
public String getEmail() { public String getEmail() {
return email; return email;
} }
public void setEmail(String email) { public void setEmail(String email) {
this.email = email; this.email = email;
} }
public User email(String email) {
this.email = email;
return this;
}
/** /**
* Get password * Get password
* @return password * @return password
@ -88,9 +124,16 @@ public class User {
public String getPassword() { public String getPassword() {
return password; return password;
} }
public void setPassword(String password) { public void setPassword(String password) {
this.password = password; this.password = password;
} }
public User password(String password) {
this.password = password;
return this;
}
/** /**
* Get phone * Get phone
* @return phone * @return phone
@ -98,9 +141,16 @@ public class User {
public String getPhone() { public String getPhone() {
return phone; return phone;
} }
public void setPhone(String phone) { public void setPhone(String phone) {
this.phone = phone; this.phone = phone;
} }
public User phone(String phone) {
this.phone = phone;
return this;
}
/** /**
* User Status * User Status
* @return userStatus * @return userStatus
@ -108,10 +158,17 @@ public class User {
public Integer getUserStatus() { public Integer getUserStatus() {
return userStatus; return userStatus;
} }
public void setUserStatus(Integer userStatus) { public void setUserStatus(Integer userStatus) {
this.userStatus = userStatus; this.userStatus = userStatus;
} }
public User userStatus(Integer userStatus) {
this.userStatus = userStatus;
return this;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -133,7 +190,7 @@ public class User {
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*/ */
private static String toIndentedString(Object o) { private static String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }