forked from loafle/openapi-generator-original
Update samples for JaxRS/RestEasy/Joda. (#5205)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 DateTime 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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user