replace tab with 4 spaces (#5174)

This commit is contained in:
wing328 2017-03-23 17:18:01 +08:00 committed by GitHub
parent 43aa4a8569
commit 8fbe82a66b
68 changed files with 390 additions and 384 deletions

View File

@ -52,7 +52,7 @@ public class {{classname}} {
@ApiResponses(value = { {{#responses}}
@ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}},{{/hasMore}}{{/responses}} })
public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {
return delegate.{{nickname}}({{#allParams}}{{#isFile}}{{paramName}}InputStream, {{paramName}}Detail{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}, {{/allParams}}securityContext);
return delegate.{{nickname}}({{#allParams}}{{#isFile}}{{paramName}}InputStream, {{paramName}}Detail{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}, {{/allParams}}securityContext);
}
{{/operation}}
}

View File

@ -2,9 +2,9 @@ package {{apiPackage}};
{{>generatedAnnotation}}
public class ApiException extends Exception{
private int code;
public ApiException (int code, String msg) {
super(msg);
this.code = code;
}
private int code;
public ApiException (int code, String msg) {
super(msg);
this.code = code;
}
}

View File

@ -7,16 +7,16 @@ import javax.servlet.http.HttpServletResponse;
{{>generatedAnnotation}}
public class ApiOriginFilter implements javax.servlet.Filter {
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse res = (HttpServletResponse) response;
res.addHeader("Access-Control-Allow-Origin", "*");
res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
res.addHeader("Access-Control-Allow-Headers", "Content-Type");
chain.doFilter(request, response);
}
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse res = (HttpServletResponse) response;
res.addHeader("Access-Control-Allow-Origin", "*");
res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
res.addHeader("Access-Control-Allow-Headers", "Content-Type");
chain.doFilter(request, response);
}
public void destroy() {}
public void destroy() {}
public void init(FilterConfig filterConfig) throws ServletException {}
}
public void init(FilterConfig filterConfig) throws ServletException {}
}

View File

@ -5,65 +5,65 @@ import javax.xml.bind.annotation.XmlTransient;
@javax.xml.bind.annotation.XmlRootElement
{{>generatedAnnotation}}
public class ApiResponseMessage {
public static final int ERROR = 1;
public static final int WARNING = 2;
public static final int INFO = 3;
public static final int OK = 4;
public static final int TOO_BUSY = 5;
public static final int ERROR = 1;
public static final int WARNING = 2;
public static final int INFO = 3;
public static final int OK = 4;
public static final int TOO_BUSY = 5;
int code;
String type;
String message;
public ApiResponseMessage(){}
public ApiResponseMessage(int code, String message){
this.code = code;
switch(code){
case ERROR:
setType("error");
break;
case WARNING:
setType("warning");
break;
case INFO:
setType("info");
break;
case OK:
setType("ok");
break;
case TOO_BUSY:
setType("too busy");
break;
default:
setType("unknown");
break;
}
this.message = message;
}
int code;
String type;
String message;
public ApiResponseMessage(){}
public ApiResponseMessage(int code, String message){
this.code = code;
switch(code){
case ERROR:
setType("error");
break;
case WARNING:
setType("warning");
break;
case INFO:
setType("info");
break;
case OK:
setType("ok");
break;
case TOO_BUSY:
setType("too busy");
break;
default:
setType("unknown");
break;
}
this.message = message;
}
@XmlTransient
public int getCode() {
return code;
}
@XmlTransient
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public void setCode(int code) {
this.code = code;
}
public String getType() {
return type;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public void setType(String type) {
this.type = type;
}
public String getMessage() {
return message;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public void setMessage(String message) {
this.message = message;
}
}

View File

@ -2,9 +2,9 @@ package {{apiPackage}};
{{>generatedAnnotation}}
public class NotFoundException extends ApiException {
private int code;
public NotFoundException (int code, String msg) {
super(code, msg);
this.code = code;
}
private int code;
public NotFoundException (int code, String msg) {
super(code, msg);
this.code = code;
}
}

View File

@ -5,5 +5,5 @@ import javax.ws.rs.core.Application;
@ApplicationPath("/")
public class RestApplication extends Application {
}
}

View File

@ -38,7 +38,7 @@ public class {{classname}} {
@ApiResponses(value = { {{#responses}}
@ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}},{{/hasMore}}{{/responses}} })
public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
{{/operation}}
}

View File

@ -12,9 +12,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
@ -31,18 +31,18 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<scope>provided</scope>
<version>1.5.3</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<scope>provided</scope>
<version>1.5.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@ -82,4 +82,4 @@
<properties>
<junit-version>4.8.1</junit-version>
</properties>
</project>
</project>

View File

@ -48,7 +48,7 @@ public class PetApi {
@ApiResponses(value = {
@ApiResponse(code = 405, message = "Invalid input", response = void.class) })
public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) {
return delegate.addPet(body, securityContext);
return delegate.addPet(body, securityContext);
}
@DELETE
@ -64,7 +64,7 @@ public class PetApi {
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid pet value", response = void.class) })
public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId, @ApiParam(value = "" )@HeaderParam("api_key") String apiKey) {
return delegate.deletePet(petId, apiKey, securityContext);
return delegate.deletePet(petId, apiKey, securityContext);
}
@GET
@ -81,7 +81,7 @@ public class PetApi {
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") })
public Response findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="available, pending, sold") @QueryParam("status") List<String> status) {
return delegate.findPetsByStatus(status, securityContext);
return delegate.findPetsByStatus(status, securityContext);
}
@GET
@ -98,7 +98,7 @@ public class PetApi {
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") })
public Response findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List<String> tags) {
return delegate.findPetsByTags(tags, securityContext);
return delegate.findPetsByTags(tags, securityContext);
}
@GET
@ -113,7 +113,7 @@ public class PetApi {
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId) {
return delegate.getPetById(petId, securityContext);
return delegate.getPetById(petId, securityContext);
}
@PUT
@ -131,7 +131,7 @@ public class PetApi {
@ApiResponse(code = 404, message = "Pet not found", response = void.class),
@ApiResponse(code = 405, message = "Validation exception", response = void.class) })
public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) {
return delegate.updatePet(body, securityContext);
return delegate.updatePet(body, securityContext);
}
@POST
@ -147,7 +147,7 @@ public class PetApi {
@ApiResponses(value = {
@ApiResponse(code = 405, message = "Invalid input", response = void.class) })
public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status) {
return delegate.updatePetWithForm(petId, name, status, securityContext);
return delegate.updatePetWithForm(petId, name, status, securityContext);
}
@POST
@ -163,6 +163,6 @@ public class PetApi {
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file", required = false) InputStream fileInputStream, @Multipart(value = "file" , required = false) Attachment fileDetail) {
return delegate.uploadFile(petId, additionalMetadata, fileInputStream, fileDetail, securityContext);
return delegate.uploadFile(petId, additionalMetadata, fileInputStream, fileDetail, securityContext);
}
}

View File

@ -43,7 +43,7 @@ public class StoreApi {
@ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class),
@ApiResponse(code = 404, message = "Order not found", response = void.class) })
public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("orderId") String orderId) {
return delegate.deleteOrder(orderId, securityContext);
return delegate.deleteOrder(orderId, securityContext);
}
@GET
@ -56,7 +56,7 @@ public class StoreApi {
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") })
public Response getInventory() {
return delegate.getInventory(securityContext);
return delegate.getInventory(securityContext);
}
@GET
@ -69,7 +69,7 @@ public class StoreApi {
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
public Response getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") Long orderId) {
return delegate.getOrderById(orderId, securityContext);
return delegate.getOrderById(orderId, securityContext);
}
@POST
@ -81,6 +81,6 @@ public class StoreApi {
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body) {
return delegate.placeOrder(body, securityContext);
return delegate.placeOrder(body, securityContext);
}
}

View File

@ -42,7 +42,7 @@ public class UserApi {
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = void.class) })
public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body) {
return delegate.createUser(body, securityContext);
return delegate.createUser(body, securityContext);
}
@POST
@ -53,7 +53,7 @@ public class UserApi {
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = void.class) })
public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List<User> body) {
return delegate.createUsersWithArrayInput(body, securityContext);
return delegate.createUsersWithArrayInput(body, securityContext);
}
@POST
@ -64,7 +64,7 @@ public class UserApi {
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = void.class) })
public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List<User> body) {
return delegate.createUsersWithListInput(body, securityContext);
return delegate.createUsersWithListInput(body, securityContext);
}
@DELETE
@ -76,7 +76,7 @@ public class UserApi {
@ApiResponse(code = 400, message = "Invalid username supplied", response = void.class),
@ApiResponse(code = 404, message = "User not found", response = void.class) })
public Response deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathParam("username") String username) {
return delegate.deleteUser(username, securityContext);
return delegate.deleteUser(username, securityContext);
}
@GET
@ -89,7 +89,7 @@ public class UserApi {
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
@ApiResponse(code = 404, message = "User not found", response = User.class) })
public Response getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true) @PathParam("username") String username) {
return delegate.getUserByName(username, securityContext);
return delegate.getUserByName(username, securityContext);
}
@GET
@ -101,7 +101,7 @@ public class UserApi {
@ApiResponse(code = 200, message = "successful operation", response = String.class),
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
public Response loginUser( @NotNull @ApiParam(value = "The user name for login",required=true) @QueryParam("username") String username, @NotNull @ApiParam(value = "The password for login in clear text",required=true) @QueryParam("password") String password) {
return delegate.loginUser(username, password, securityContext);
return delegate.loginUser(username, password, securityContext);
}
@GET
@ -112,7 +112,7 @@ public class UserApi {
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = void.class) })
public Response logoutUser() {
return delegate.logoutUser(securityContext);
return delegate.logoutUser(securityContext);
}
@PUT
@ -124,6 +124,6 @@ public class UserApi {
@ApiResponse(code = 400, message = "Invalid user supplied", response = void.class),
@ApiResponse(code = 404, message = "User not found", response = void.class) })
public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username, @ApiParam(value = "Updated user object" ,required=true) User body) {
return delegate.updateUser(username, body, securityContext);
return delegate.updateUser(username, body, securityContext);
}
}

View File

@ -29,7 +29,7 @@ public class Category {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("id")
public Long getId() {
return id;
@ -46,7 +46,7 @@ public class Category {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("name")
public String getName() {
return name;

View File

@ -30,7 +30,7 @@ public class ModelApiResponse {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("code")
public Integer getCode() {
return code;
@ -47,7 +47,7 @@ public class ModelApiResponse {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("type")
public String getType() {
return type;
@ -64,7 +64,7 @@ public class ModelApiResponse {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("message")
public String getMessage() {
return message;

View File

@ -66,7 +66,7 @@ public enum StatusEnum {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("id")
public Long getId() {
return id;
@ -83,7 +83,7 @@ public enum StatusEnum {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("petId")
public Long getPetId() {
return petId;
@ -100,7 +100,7 @@ public enum StatusEnum {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("quantity")
public Integer getQuantity() {
return quantity;
@ -117,7 +117,7 @@ public enum StatusEnum {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("shipDate")
public java.util.Date getShipDate() {
return shipDate;
@ -135,7 +135,7 @@ public enum StatusEnum {
}
@ApiModelProperty(example = "null", value = "Order Status")
@ApiModelProperty(value = "Order Status")
@JsonProperty("status")
public StatusEnum getStatus() {
return status;
@ -152,7 +152,7 @@ public enum StatusEnum {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("complete")
public Boolean getComplete() {
return complete;

View File

@ -70,7 +70,7 @@ public enum StatusEnum {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("id")
public Long getId() {
return id;
@ -87,7 +87,7 @@ public enum StatusEnum {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("category")
public Category getCategory() {
return category;
@ -122,7 +122,7 @@ public enum StatusEnum {
}
@ApiModelProperty(example = "null", required = true, value = "")
@ApiModelProperty(required = true, value = "")
@JsonProperty("photoUrls")
@NotNull
public List<String> getPhotoUrls() {
@ -140,7 +140,7 @@ public enum StatusEnum {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("tags")
public List<Tag> getTags() {
return tags;
@ -158,7 +158,7 @@ public enum StatusEnum {
}
@ApiModelProperty(example = "null", value = "pet status in the store")
@ApiModelProperty(value = "pet status in the store")
@JsonProperty("status")
public StatusEnum getStatus() {
return status;

View File

@ -29,7 +29,7 @@ public class Tag {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("id")
public Long getId() {
return id;
@ -46,7 +46,7 @@ public class Tag {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("name")
public String getName() {
return name;

View File

@ -35,7 +35,7 @@ public class User {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("id")
public Long getId() {
return id;
@ -52,7 +52,7 @@ public class User {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("username")
public String getUsername() {
return username;
@ -69,7 +69,7 @@ public class User {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("firstName")
public String getFirstName() {
return firstName;
@ -86,7 +86,7 @@ public class User {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("lastName")
public String getLastName() {
return lastName;
@ -103,7 +103,7 @@ public class User {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("email")
public String getEmail() {
return email;
@ -120,7 +120,7 @@ public class User {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("password")
public String getPassword() {
return password;
@ -137,7 +137,7 @@ public class User {
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("phone")
public String getPhone() {
return phone;
@ -155,7 +155,7 @@ public class User {
}
@ApiModelProperty(example = "null", value = "User Status")
@ApiModelProperty(value = "User Status")
@JsonProperty("userStatus")
public Integer getUserStatus() {
return userStatus;

View File

@ -108,8 +108,8 @@
"type" : "array",
"items" : {
"type" : "string",
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
},
"collectionFormat" : "csv"
} ],

View File

@ -2,6 +2,7 @@ package io.swagger.api;
import java.math.BigDecimal;
import io.swagger.model.Client;
import java.util.Date;
import org.joda.time.LocalDate;
import java.io.InputStream;
@ -42,7 +43,7 @@ public interface FakeApi {
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid username supplied"),
@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) javax.xml.datatype.XMLGregorianCalendar 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);
@GET
@Path("/fake")

View File

@ -91,6 +91,6 @@ public interface UserApi {
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid user supplied"),
@ApiResponse(code = 404, message = "User not found") })
public void updateUser(@Valid @PathParam("username") String username, User body);
public void updateUser(@PathParam("username") String username, @Valid User body);
}

View File

@ -16,9 +16,9 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class AdditionalPropertiesClass {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Map<String, String> mapProperty = new HashMap<String, String>();
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Map<String, Map<String, String>> mapOfMapProperty = new HashMap<String, Map<String, String>>();
/**

View File

@ -15,9 +15,9 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class Animal {
@ApiModelProperty(example = "null", required = true, value = "")
@ApiModelProperty(required = true, value = "")
private String className = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String color = "red";
/**

View File

@ -16,7 +16,7 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class ArrayOfArrayOfNumberOnly {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<List<BigDecimal>>();
/**

View File

@ -16,7 +16,7 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class ArrayOfNumberOnly {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private List<BigDecimal> arrayNumber = new ArrayList<BigDecimal>();
/**

View File

@ -16,11 +16,11 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class ArrayTest {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private List<String> arrayOfString = new ArrayList<String>();
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private List<List<Long>> arrayArrayOfInteger = new ArrayList<List<Long>>();
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
/**

View File

@ -13,17 +13,17 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class Capitalization {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String smallCamel = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String capitalCamel = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String smallSnake = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String capitalSnake = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String scAETHFlowPoints = null;
@ApiModelProperty(example = "null", value = "Name of the pet ")
@ApiModelProperty(value = "Name of the pet ")
private String ATT_NAME = null;
/**

View File

@ -14,7 +14,7 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class Cat extends Animal {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Boolean declawed = null;
/**

View File

@ -13,9 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class Category {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Long id = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String name = null;
/**

View File

@ -15,7 +15,7 @@ import javax.xml.bind.annotation.XmlEnumValue;
@ApiModel(description="Model for testing model with \"_class\" property")
public class ClassModel {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String propertyClass = null;
/**

View File

@ -13,7 +13,7 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class Client {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String client = null;
/**

View File

@ -14,7 +14,7 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class Dog extends Animal {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String breed = null;
/**

View File

@ -48,7 +48,7 @@ public enum JustSymbolEnum {
}
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private JustSymbolEnum justSymbol = null;
@XmlType(name="ArrayEnumEnum")
@ -83,7 +83,7 @@ public enum ArrayEnumEnum {
}
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private List<ArrayEnumEnum> arrayEnum = new ArrayList<ArrayEnumEnum>();
/**

View File

@ -47,7 +47,7 @@ public enum EnumStringEnum {
}
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private EnumStringEnum enumString = null;
@XmlType(name="EnumIntegerEnum")
@ -82,7 +82,7 @@ public enum EnumIntegerEnum {
}
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private EnumIntegerEnum enumInteger = null;
@XmlType(name="EnumNumberEnum")
@ -117,9 +117,9 @@ public enum EnumNumberEnum {
}
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private EnumNumberEnum enumNumber = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private OuterEnum outerEnum = null;
/**

View File

@ -1,6 +1,7 @@
package io.swagger.model;
import java.math.BigDecimal;
import java.util.Date;
import java.util.UUID;
import org.joda.time.LocalDate;
import javax.validation.constraints.*;
@ -16,31 +17,31 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class FormatTest {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Integer integer = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Integer int32 = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Long int64 = null;
@ApiModelProperty(example = "null", required = true, value = "")
@ApiModelProperty(required = true, value = "")
private BigDecimal number = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Float _float = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Double _double = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String string = null;
@ApiModelProperty(example = "null", required = true, value = "")
@ApiModelProperty(required = true, value = "")
private byte[] _byte = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private byte[] binary = null;
@ApiModelProperty(example = "null", required = true, value = "")
@ApiModelProperty(required = true, value = "")
private LocalDate date = null;
@ApiModelProperty(example = "null", value = "")
private javax.xml.datatype.XMLGregorianCalendar dateTime = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Date dateTime = null;
@ApiModelProperty(value = "")
private UUID uuid = null;
@ApiModelProperty(example = "null", required = true, value = "")
@ApiModelProperty(required = true, value = "")
private String password = null;
/**
@ -230,15 +231,15 @@ public class FormatTest {
* Get dateTime
* @return dateTime
**/
public javax.xml.datatype.XMLGregorianCalendar getDateTime() {
public Date getDateTime() {
return dateTime;
}
public void setDateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) {
public void setDateTime(Date dateTime) {
this.dateTime = dateTime;
}
public FormatTest dateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) {
public FormatTest dateTime(Date dateTime) {
this.dateTime = dateTime;
return this;
}

View File

@ -13,9 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class HasOnlyReadOnly {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String bar = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String foo = null;
/**

View File

@ -16,7 +16,7 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class MapTest {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Map<String, Map<String, String>> mapMapOfString = new HashMap<String, Map<String, String>>();
@XmlType(name="InnerEnum")
@ -51,7 +51,7 @@ public enum InnerEnum {
}
}
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Map<String, InnerEnum> mapOfEnumString = new HashMap<String, InnerEnum>();
/**

View File

@ -1,6 +1,7 @@
package io.swagger.model;
import io.swagger.model.Animal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -18,11 +19,11 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class MixedPropertiesAndAdditionalPropertiesClass {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private UUID uuid = null;
@ApiModelProperty(example = "null", value = "")
private javax.xml.datatype.XMLGregorianCalendar dateTime = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Date dateTime = null;
@ApiModelProperty(value = "")
private Map<String, Animal> map = new HashMap<String, Animal>();
/**
@ -46,15 +47,15 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
* Get dateTime
* @return dateTime
**/
public javax.xml.datatype.XMLGregorianCalendar getDateTime() {
public Date getDateTime() {
return dateTime;
}
public void setDateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) {
public void setDateTime(Date dateTime) {
this.dateTime = dateTime;
}
public MixedPropertiesAndAdditionalPropertiesClass dateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) {
public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) {
this.dateTime = dateTime;
return this;
}

View File

@ -15,9 +15,9 @@ import javax.xml.bind.annotation.XmlEnumValue;
@ApiModel(description="Model for testing model name starting with number")
public class Model200Response {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Integer name = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String propertyClass = null;
/**

View File

@ -13,11 +13,11 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class ModelApiResponse {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Integer code = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String type = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String message = null;
/**

View File

@ -15,7 +15,7 @@ import javax.xml.bind.annotation.XmlEnumValue;
@ApiModel(description="Model for testing reserved words")
public class ModelReturn {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Integer _return = null;
/**

View File

@ -15,13 +15,13 @@ import javax.xml.bind.annotation.XmlEnumValue;
@ApiModel(description="Model for testing model name same as property name")
public class Name {
@ApiModelProperty(example = "null", required = true, value = "")
@ApiModelProperty(required = true, value = "")
private Integer name = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Integer snakeCase = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String property = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Integer _123Number = null;
/**

View File

@ -14,7 +14,7 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class NumberOnly {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private BigDecimal justNumber = null;
/**

View File

@ -1,5 +1,6 @@
package io.swagger.model;
import java.util.Date;
import javax.validation.constraints.*;
import io.swagger.annotations.ApiModelProperty;
@ -13,14 +14,14 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class Order {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Long id = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Long petId = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Integer quantity = null;
@ApiModelProperty(example = "null", value = "")
private javax.xml.datatype.XMLGregorianCalendar shipDate = null;
@ApiModelProperty(value = "")
private Date shipDate = null;
@XmlType(name="StatusEnum")
@XmlEnum(String.class)
@ -54,9 +55,9 @@ public enum StatusEnum {
}
}
@ApiModelProperty(example = "null", value = "Order Status")
@ApiModelProperty(value = "Order Status")
private StatusEnum status = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Boolean complete = false;
/**
@ -114,15 +115,15 @@ public enum StatusEnum {
* Get shipDate
* @return shipDate
**/
public javax.xml.datatype.XMLGregorianCalendar getShipDate() {
public Date getShipDate() {
return shipDate;
}
public void setShipDate(javax.xml.datatype.XMLGregorianCalendar shipDate) {
public void setShipDate(Date shipDate) {
this.shipDate = shipDate;
}
public Order shipDate(javax.xml.datatype.XMLGregorianCalendar shipDate) {
public Order shipDate(Date shipDate) {
this.shipDate = shipDate;
return this;
}

View File

@ -17,15 +17,15 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class Pet {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Long id = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Category category = null;
@ApiModelProperty(example = "doggie", required = true, value = "")
private String name = null;
@ApiModelProperty(example = "null", required = true, value = "")
@ApiModelProperty(required = true, value = "")
private List<String> photoUrls = new ArrayList<String>();
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private List<Tag> tags = new ArrayList<Tag>();
@XmlType(name="StatusEnum")
@ -60,7 +60,7 @@ public enum StatusEnum {
}
}
@ApiModelProperty(example = "null", value = "pet status in the store")
@ApiModelProperty(value = "pet status in the store")
private StatusEnum status = null;
/**

View File

@ -13,9 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class ReadOnlyFirst {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String bar = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String baz = null;
/**

View File

@ -13,7 +13,7 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class SpecialModelName {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Long specialPropertyName = null;
/**

View File

@ -13,9 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class Tag {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Long id = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String name = null;
/**

View File

@ -13,21 +13,21 @@ import javax.xml.bind.annotation.XmlEnumValue;
public class User {
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private Long id = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String username = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String firstName = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String lastName = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String email = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String password = null;
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
private String phone = null;
@ApiModelProperty(example = "null", value = "User Status")
@ApiModelProperty(value = "User Status")
private Integer userStatus = null;
/**

View File

@ -3,6 +3,7 @@ package io.swagger.api.impl;
import io.swagger.api.*;
import java.math.BigDecimal;
import io.swagger.model.Client;
import java.util.Date;
import org.joda.time.LocalDate;
import java.io.InputStream;
@ -25,7 +26,7 @@ public class FakeApiServiceImpl implements FakeApi {
return null;
}
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, javax.xml.datatype.XMLGregorianCalendar 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...

View File

@ -27,6 +27,7 @@ package io.swagger.api;
import java.math.BigDecimal;
import io.swagger.model.Client;
import java.util.Date;
import org.joda.time.LocalDate;
import org.junit.Test;
import org.junit.Before;
@ -108,7 +109,7 @@ public class FakeApiTest {
String string = null;
byte[] binary = null;
LocalDate date = null;
javax.xml.datatype.XMLGregorianCalendar dateTime = null;
Date dateTime = null;
String password = null;
String paramCallback = null;
//api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);

View File

@ -80,7 +80,7 @@ public class PetApiTest {
@Test
public void addPetTest() {
Pet body = null;
//api.addPet(body);
//api.addPet(body);
// TODO: test validations
@ -99,7 +99,7 @@ public class PetApiTest {
public void deletePetTest() {
Long petId = null;
String apiKey = null;
//api.deletePet(petId, apiKey);
//api.deletePet(petId, apiKey);
// TODO: test validations
@ -153,7 +153,7 @@ public class PetApiTest {
@Test
public void getPetByIdTest() {
Long petId = null;
//Pet response = api.getPetById(petId);
//Pet response = api.getPetById(petId);
//assertNotNull(response);
// TODO: test validations
@ -171,7 +171,7 @@ public class PetApiTest {
@Test
public void updatePetTest() {
Pet body = null;
//api.updatePet(body);
//api.updatePet(body);
// TODO: test validations
@ -191,7 +191,7 @@ public class PetApiTest {
Long petId = null;
String name = null;
String status = null;
//api.updatePetWithForm(petId, name, status);
//api.updatePetWithForm(petId, name, status);
// TODO: test validations
@ -211,7 +211,7 @@ public class PetApiTest {
Long petId = null;
String additionalMetadata = null;
org.apache.cxf.jaxrs.ext.multipart.Attachment file = null;
//ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file);
//ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file);
//assertNotNull(response);
// TODO: test validations

View File

@ -79,7 +79,7 @@ public class StoreApiTest {
@Test
public void deleteOrderTest() {
String orderId = null;
//api.deleteOrder(orderId);
//api.deleteOrder(orderId);
// TODO: test validations
@ -114,7 +114,7 @@ public class StoreApiTest {
@Test
public void getOrderByIdTest() {
Long orderId = null;
//Order response = api.getOrderById(orderId);
//Order response = api.getOrderById(orderId);
//assertNotNull(response);
// TODO: test validations
@ -132,7 +132,7 @@ public class StoreApiTest {
@Test
public void placeOrderTest() {
Order body = null;
//Order response = api.placeOrder(body);
//Order response = api.placeOrder(body);
//assertNotNull(response);
// TODO: test validations

View File

@ -79,7 +79,7 @@ public class UserApiTest {
@Test
public void createUserTest() {
User body = null;
//api.createUser(body);
//api.createUser(body);
// TODO: test validations
@ -97,7 +97,7 @@ public class UserApiTest {
@Test
public void createUsersWithArrayInputTest() {
List<User> body = null;
//api.createUsersWithArrayInput(body);
//api.createUsersWithArrayInput(body);
// TODO: test validations
@ -115,7 +115,7 @@ public class UserApiTest {
@Test
public void createUsersWithListInputTest() {
List<User> body = null;
//api.createUsersWithListInput(body);
//api.createUsersWithListInput(body);
// TODO: test validations
@ -133,7 +133,7 @@ public class UserApiTest {
@Test
public void deleteUserTest() {
String username = null;
//api.deleteUser(username);
//api.deleteUser(username);
// TODO: test validations
@ -151,7 +151,7 @@ public class UserApiTest {
@Test
public void getUserByNameTest() {
String username = null;
//User response = api.getUserByName(username);
//User response = api.getUserByName(username);
//assertNotNull(response);
// TODO: test validations
@ -170,7 +170,7 @@ public class UserApiTest {
public void loginUserTest() {
String username = null;
String password = null;
//String response = api.loginUser(username, password);
//String response = api.loginUser(username, password);
//assertNotNull(response);
// TODO: test validations
@ -187,7 +187,7 @@ public class UserApiTest {
*/
@Test
public void logoutUserTest() {
//api.logoutUser();
//api.logoutUser();
// TODO: test validations
@ -206,7 +206,7 @@ public class UserApiTest {
public void updateUserTest() {
String username = null;
User body = null;
//api.updateUser(username, body);
//api.updateUser(username, body);
// TODO: test validations

View File

@ -2,9 +2,9 @@ package io.swagger.api;
public class ApiException extends Exception{
private int code;
public ApiException (int code, String msg) {
super(msg);
this.code = code;
}
private int code;
public ApiException (int code, String msg) {
super(msg);
this.code = code;
}
}

View File

@ -7,16 +7,16 @@ import javax.servlet.http.HttpServletResponse;
public class ApiOriginFilter implements javax.servlet.Filter {
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse res = (HttpServletResponse) response;
res.addHeader("Access-Control-Allow-Origin", "*");
res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
res.addHeader("Access-Control-Allow-Headers", "Content-Type");
chain.doFilter(request, response);
}
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse res = (HttpServletResponse) response;
res.addHeader("Access-Control-Allow-Origin", "*");
res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
res.addHeader("Access-Control-Allow-Headers", "Content-Type");
chain.doFilter(request, response);
}
public void destroy() {}
public void destroy() {}
public void init(FilterConfig filterConfig) throws ServletException {}
}
public void init(FilterConfig filterConfig) throws ServletException {}
}

View File

@ -5,65 +5,65 @@ import javax.xml.bind.annotation.XmlTransient;
@javax.xml.bind.annotation.XmlRootElement
public class ApiResponseMessage {
public static final int ERROR = 1;
public static final int WARNING = 2;
public static final int INFO = 3;
public static final int OK = 4;
public static final int TOO_BUSY = 5;
public static final int ERROR = 1;
public static final int WARNING = 2;
public static final int INFO = 3;
public static final int OK = 4;
public static final int TOO_BUSY = 5;
int code;
String type;
String message;
public ApiResponseMessage(){}
public ApiResponseMessage(int code, String message){
this.code = code;
switch(code){
case ERROR:
setType("error");
break;
case WARNING:
setType("warning");
break;
case INFO:
setType("info");
break;
case OK:
setType("ok");
break;
case TOO_BUSY:
setType("too busy");
break;
default:
setType("unknown");
break;
}
this.message = message;
}
int code;
String type;
String message;
public ApiResponseMessage(){}
public ApiResponseMessage(int code, String message){
this.code = code;
switch(code){
case ERROR:
setType("error");
break;
case WARNING:
setType("warning");
break;
case INFO:
setType("info");
break;
case OK:
setType("ok");
break;
case TOO_BUSY:
setType("too busy");
break;
default:
setType("unknown");
break;
}
this.message = message;
}
@XmlTransient
public int getCode() {
return code;
}
@XmlTransient
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public void setCode(int code) {
this.code = code;
}
public String getType() {
return type;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public void setType(String type) {
this.type = type;
}
public String getMessage() {
return message;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public void setMessage(String message) {
this.message = message;
}
}

View File

@ -2,9 +2,9 @@ package io.swagger.api;
public class NotFoundException extends ApiException {
private int code;
public NotFoundException (int code, String msg) {
super(code, msg);
this.code = code;
}
private int code;
public NotFoundException (int code, String msg) {
super(code, msg);
this.code = code;
}
}

View File

@ -18,7 +18,7 @@ public class Category {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("id")
public Long getId() {
return id;
@ -30,7 +30,7 @@ public class Category {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("name")
public String getName() {
return name;

View File

@ -19,7 +19,7 @@ public class ModelApiResponse {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("code")
public Integer getCode() {
return code;
@ -31,7 +31,7 @@ public class ModelApiResponse {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("type")
public String getType() {
return type;
@ -43,7 +43,7 @@ public class ModelApiResponse {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("message")
public String getMessage() {
return message;

View File

@ -47,7 +47,7 @@ public class Order {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("id")
public Long getId() {
return id;
@ -59,7 +59,7 @@ public class Order {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("petId")
public Long getPetId() {
return petId;
@ -71,7 +71,7 @@ public class Order {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("quantity")
public Integer getQuantity() {
return quantity;
@ -83,7 +83,7 @@ public class Order {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("shipDate")
public Date getShipDate() {
return shipDate;
@ -96,7 +96,7 @@ public class Order {
* Order Status
**/
@ApiModelProperty(example = "null", value = "Order Status")
@ApiModelProperty(value = "Order Status")
@JsonProperty("status")
public StatusEnum getStatus() {
return status;
@ -108,7 +108,7 @@ public class Order {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("complete")
public Boolean getComplete() {
return complete;

View File

@ -49,7 +49,7 @@ public class Pet {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("id")
public Long getId() {
return id;
@ -61,7 +61,7 @@ public class Pet {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("category")
public Category getCategory() {
return category;
@ -86,7 +86,7 @@ public class Pet {
/**
**/
@ApiModelProperty(example = "null", required = true, value = "")
@ApiModelProperty(required = true, value = "")
@JsonProperty("photoUrls")
@NotNull
public List<String> getPhotoUrls() {
@ -99,7 +99,7 @@ public class Pet {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("tags")
public List<Tag> getTags() {
return tags;
@ -112,7 +112,7 @@ public class Pet {
* pet status in the store
**/
@ApiModelProperty(example = "null", value = "pet status in the store")
@ApiModelProperty(value = "pet status in the store")
@JsonProperty("status")
public StatusEnum getStatus() {
return status;

View File

@ -18,7 +18,7 @@ public class Tag {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("id")
public Long getId() {
return id;
@ -30,7 +30,7 @@ public class Tag {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("name")
public String getName() {
return name;

View File

@ -24,7 +24,7 @@ public class User {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("id")
public Long getId() {
return id;
@ -36,7 +36,7 @@ public class User {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("username")
public String getUsername() {
return username;
@ -48,7 +48,7 @@ public class User {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("firstName")
public String getFirstName() {
return firstName;
@ -60,7 +60,7 @@ public class User {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("lastName")
public String getLastName() {
return lastName;
@ -72,7 +72,7 @@ public class User {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("email")
public String getEmail() {
return email;
@ -84,7 +84,7 @@ public class User {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("password")
public String getPassword() {
return password;
@ -96,7 +96,7 @@ public class User {
/**
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("phone")
public String getPhone() {
return phone;
@ -109,7 +109,7 @@ public class User {
* User Status
**/
@ApiModelProperty(example = "null", value = "User Status")
@ApiModelProperty(value = "User Status")
@JsonProperty("userStatus")
public Integer getUserStatus() {
return userStatus;

View File

@ -30,7 +30,7 @@ public class FakeApi {
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
public Response testClientModel(Client body) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@POST
@ -44,7 +44,7 @@ public class FakeApi {
@ApiResponse(code = 400, message = "Invalid username supplied", response = void.class),
@ApiResponse(code = 404, message = "User not found", response = void.class) })
public Response testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string,@FormParam(value = "binary") byte[] binary,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") Date dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@GET
@ -56,7 +56,7 @@ public class FakeApi {
@ApiResponse(code = 400, message = "Invalid request", response = void.class),
@ApiResponse(code = 404, message = "Not found", response = void.class) })
public Response testEnumParameters(@FormParam(value = "enum_form_string_array") List<String> enumFormStringArray,@FormParam(value = "enum_form_string") 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,@FormParam(value = "enum_query_double") Double enumQueryDouble) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
}

View File

@ -34,7 +34,7 @@ public class PetApi {
@ApiResponses(value = {
@ApiResponse(code = 405, message = "Invalid input", response = void.class) })
public Response addPet(Pet body) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@DELETE
@ -50,7 +50,7 @@ public class PetApi {
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid pet value", response = void.class) })
public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@GET
@ -67,7 +67,7 @@ public class PetApi {
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") })
public Response findPetsByStatus(@QueryParam("status") @NotNull List<String> status) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@GET
@ -84,7 +84,7 @@ public class PetApi {
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") })
public Response findPetsByTags(@QueryParam("tags") @NotNull List<String> tags) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@GET
@ -99,7 +99,7 @@ public class PetApi {
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
public Response getPetById(@PathParam("petId") @ApiParam("ID of pet to return") Long petId) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@PUT
@ -117,7 +117,7 @@ public class PetApi {
@ApiResponse(code = 404, message = "Pet not found", response = void.class),
@ApiResponse(code = 405, message = "Validation exception", response = void.class) })
public Response updatePet(Pet body) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@POST
@ -133,7 +133,7 @@ public class PetApi {
@ApiResponses(value = {
@ApiResponse(code = 405, message = "Invalid input", response = void.class) })
public Response updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@POST
@ -150,7 +150,7 @@ public class PetApi {
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
public Response uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream fileInputStream,
@FormParam(value = "file") Attachment fileDetail) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
}

View File

@ -29,7 +29,7 @@ public class StoreApi {
@ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class),
@ApiResponse(code = 404, message = "Order not found", response = void.class) })
public Response deleteOrder(@PathParam("orderId") @ApiParam("ID of the order that needs to be deleted") String orderId) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@GET
@ -42,7 +42,7 @@ public class StoreApi {
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") })
public Response getInventory() {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@GET
@ -55,7 +55,7 @@ public class StoreApi {
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
public Response getOrderById(@PathParam("orderId") @Min(1) @Max(5) @ApiParam("ID of pet that needs to be fetched") Long orderId) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@POST
@ -67,7 +67,7 @@ public class StoreApi {
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
public Response placeOrder(Order body) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
}

View File

@ -28,7 +28,7 @@ public class UserApi {
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = void.class) })
public Response createUser(User body) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@POST
@ -39,7 +39,7 @@ public class UserApi {
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = void.class) })
public Response createUsersWithArrayInput(List<User> body) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@POST
@ -50,7 +50,7 @@ public class UserApi {
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = void.class) })
public Response createUsersWithListInput(List<User> body) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@DELETE
@ -62,7 +62,7 @@ public class UserApi {
@ApiResponse(code = 400, message = "Invalid username supplied", response = void.class),
@ApiResponse(code = 404, message = "User not found", response = void.class) })
public Response deleteUser(@PathParam("username") @ApiParam("The name that needs to be deleted") String username) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@GET
@ -75,7 +75,7 @@ public class UserApi {
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
@ApiResponse(code = 404, message = "User not found", response = User.class) })
public Response getUserByName(@PathParam("username") @ApiParam("The name that needs to be fetched. Use user1 for testing. ") String username) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@GET
@ -87,7 +87,7 @@ public class UserApi {
@ApiResponse(code = 200, message = "successful operation", response = String.class),
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
public Response loginUser(@QueryParam("username") @NotNull String username,@QueryParam("password") @NotNull String password) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@GET
@ -98,7 +98,7 @@ public class UserApi {
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = void.class) })
public Response logoutUser() {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
@PUT
@ -110,7 +110,7 @@ public class UserApi {
@ApiResponse(code = 400, message = "Invalid user supplied", response = void.class),
@ApiResponse(code = 404, message = "User not found", response = void.class) })
public Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,User body) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
}

View File

@ -727,8 +727,8 @@
},
"post" : {
"tags" : [ "fake" ],
"summary" : "Fake endpoint for testing various parameters\n???\n?????????\n?? ?? ???\n",
"description" : "Fake endpoint for testing various parameters\n???\n?????????\n?? ?? ???\n",
"summary" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n",
"description" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n",
"operationId" : "testEndpointParameters",
"consumes" : [ "application/xml; charset=utf-8", "application/json; charset=utf-8" ],
"produces" : [ "application/xml; charset=utf-8", "application/json; charset=utf-8" ],