Merge branch 'master' into java-imports

Conflicts:
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java
This commit is contained in:
xhh
2016-02-22 09:24:58 +08:00
728 changed files with 38867 additions and 3780 deletions

View File

@@ -1,3 +1,6 @@
apply plugin: 'idea'
apply plugin: 'eclipse'
group = 'io.swagger'
version = '1.0.0'

View File

@@ -18,7 +18,7 @@ import feign.slf4j.Slf4jLogger;
import io.swagger.client.auth.*;
import io.swagger.client.auth.OAuth.AccessTokenListener;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-11T21:48:33.457Z")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:23.375+08:00")
public class ApiClient {
public interface Api {}
@@ -42,8 +42,16 @@ public class ApiClient {
RequestInterceptor auth;
if (authName == "petstore_auth") {
auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
} else if (authName == "test_api_client_id") {
auth = new ApiKeyAuth("header", "x-test_api_client_id");
} else if (authName == "test_api_client_secret") {
auth = new ApiKeyAuth("header", "x-test_api_client_secret");
} else if (authName == "api_key") {
auth = new ApiKeyAuth("header", "api_key");
} else if (authName == "test_api_key_query") {
auth = new ApiKeyAuth("query", "test_api_key_query");
} else if (authName == "test_api_key_header") {
auth = new ApiKeyAuth("header", "test_api_key_header");
} else {
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
}

View File

@@ -11,7 +11,7 @@ import java.util.List;
import java.util.Map;
import feign.*;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-11T21:48:33.457Z")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:23.375+08:00")
public interface PetApi extends ApiClient.Api {
@@ -125,4 +125,30 @@ public interface PetApi extends ApiClient.Api {
})
void uploadFile(@Param("petId") Long petId, @Param("additionalMetadata") String additionalMetadata, @Param("file") File file);
/**
* Fake endpoint to test byte array return by 'Find pet by ID'
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched
* @return byte[]
*/
@RequestLine("GET /pet/{petId}?testing_byte_array=true")
@Headers({
"Content-type: application/json",
"Accepts: application/json",
})
byte[] getPetByIdWithByteArray(@Param("petId") Long petId);
/**
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
*
* @param body Pet object in the form of byte array
* @return void
*/
@RequestLine("POST /pet?testing_byte_array=true")
@Headers({
"Content-type: application/json",
"Accepts: application/json",
})
void addPetUsingByteArray(byte[] body);
}

View File

@@ -2,7 +2,6 @@ package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -10,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-11T21:48:33.457Z")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:23.375+08:00")
public class Category {
private Long id = null;
@@ -19,8 +18,13 @@ public class Category {
/**
**/
public Category id(Long id) {
this.id = id;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
public Long getId() {
return id;
@@ -32,8 +36,13 @@ public class Category {
/**
**/
public Category name(String name) {
this.name = name;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("name")
public String getName() {
return name;
@@ -45,7 +54,7 @@ public class Category {
@Override
public boolean equals(Object o) {
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
@@ -53,10 +62,8 @@ public class Category {
return false;
}
Category category = (Category) o;
return true && Objects.equals(id, category.id) &&
Objects.equals(name, category.name)
;
return Objects.equals(this.id, category.id) &&
Objects.equals(this.name, category.name);
}
@Override
@@ -79,7 +86,7 @@ public class Category {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}

View File

@@ -11,7 +11,7 @@ import java.util.Date;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-11T21:48:33.457Z")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:23.375+08:00")
public class Order {
private Long id = null;
@@ -44,8 +44,13 @@ public class Order {
/**
**/
public Order id(Long id) {
this.id = id;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
public Long getId() {
return id;
@@ -57,8 +62,13 @@ public class Order {
/**
**/
public Order petId(Long petId) {
this.petId = petId;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("petId")
public Long getPetId() {
return petId;
@@ -70,8 +80,13 @@ public class Order {
/**
**/
public Order quantity(Integer quantity) {
this.quantity = quantity;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("quantity")
public Integer getQuantity() {
return quantity;
@@ -83,8 +98,13 @@ public class Order {
/**
**/
public Order shipDate(Date shipDate) {
this.shipDate = shipDate;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("shipDate")
public Date getShipDate() {
return shipDate;
@@ -97,8 +117,13 @@ public class Order {
/**
* Order Status
**/
public Order status(StatusEnum status) {
this.status = status;
return this;
}
@ApiModelProperty(value = "Order Status")
@ApiModelProperty(example = "null", value = "Order Status")
@JsonProperty("status")
public StatusEnum getStatus() {
return status;
@@ -110,8 +135,13 @@ public class Order {
/**
**/
public Order complete(Boolean complete) {
this.complete = complete;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("complete")
public Boolean getComplete() {
return complete;
@@ -123,7 +153,7 @@ public class Order {
@Override
public boolean equals(Object o) {
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
@@ -131,14 +161,12 @@ public class Order {
return false;
}
Order order = (Order) o;
return true && Objects.equals(id, order.id) &&
Objects.equals(petId, order.petId) &&
Objects.equals(quantity, order.quantity) &&
Objects.equals(shipDate, order.shipDate) &&
Objects.equals(status, order.status) &&
Objects.equals(complete, order.complete)
;
return Objects.equals(this.id, order.id) &&
Objects.equals(this.petId, order.petId) &&
Objects.equals(this.quantity, order.quantity) &&
Objects.equals(this.shipDate, order.shipDate) &&
Objects.equals(this.status, order.status) &&
Objects.equals(this.complete, order.complete);
}
@Override
@@ -165,7 +193,7 @@ public class Order {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}

View File

@@ -14,7 +14,7 @@ import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-11T21:48:33.457Z")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:23.375+08:00")
public class Pet {
private Long id = null;
@@ -47,8 +47,13 @@ public class Pet {
/**
**/
public Pet id(Long id) {
this.id = id;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
public Long getId() {
return id;
@@ -60,8 +65,13 @@ public class Pet {
/**
**/
public Pet category(Category category) {
this.category = category;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("category")
public Category getCategory() {
return category;
@@ -73,8 +83,13 @@ public class Pet {
/**
**/
public Pet name(String name) {
this.name = name;
return this;
}
@ApiModelProperty(required = true, value = "")
@ApiModelProperty(example = "doggie", required = true, value = "")
@JsonProperty("name")
public String getName() {
return name;
@@ -86,8 +101,13 @@ public class Pet {
/**
**/
public Pet photoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
return this;
}
@ApiModelProperty(required = true, value = "")
@ApiModelProperty(example = "null", required = true, value = "")
@JsonProperty("photoUrls")
public List<String> getPhotoUrls() {
return photoUrls;
@@ -99,8 +119,13 @@ public class Pet {
/**
**/
public Pet tags(List<Tag> tags) {
this.tags = tags;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("tags")
public List<Tag> getTags() {
return tags;
@@ -113,8 +138,13 @@ public class Pet {
/**
* pet status in the store
**/
public Pet status(StatusEnum status) {
this.status = status;
return this;
}
@ApiModelProperty(value = "pet status in the store")
@ApiModelProperty(example = "null", value = "pet status in the store")
@JsonProperty("status")
public StatusEnum getStatus() {
return status;
@@ -126,7 +156,7 @@ public class Pet {
@Override
public boolean equals(Object o) {
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
@@ -134,14 +164,12 @@ public class Pet {
return false;
}
Pet pet = (Pet) o;
return true && Objects.equals(id, pet.id) &&
Objects.equals(category, pet.category) &&
Objects.equals(name, pet.name) &&
Objects.equals(photoUrls, pet.photoUrls) &&
Objects.equals(tags, pet.tags) &&
Objects.equals(status, pet.status)
;
return Objects.equals(this.id, pet.id) &&
Objects.equals(this.category, pet.category) &&
Objects.equals(this.name, pet.name) &&
Objects.equals(this.photoUrls, pet.photoUrls) &&
Objects.equals(this.tags, pet.tags) &&
Objects.equals(this.status, pet.status);
}
@Override
@@ -168,7 +196,7 @@ public class Pet {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}

View File

@@ -2,7 +2,6 @@ package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -10,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-11T21:48:33.457Z")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:23.375+08:00")
public class Tag {
private Long id = null;
@@ -19,8 +18,13 @@ public class Tag {
/**
**/
public Tag id(Long id) {
this.id = id;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
public Long getId() {
return id;
@@ -32,8 +36,13 @@ public class Tag {
/**
**/
public Tag name(String name) {
this.name = name;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("name")
public String getName() {
return name;
@@ -45,7 +54,7 @@ public class Tag {
@Override
public boolean equals(Object o) {
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
@@ -53,10 +62,8 @@ public class Tag {
return false;
}
Tag tag = (Tag) o;
return true && Objects.equals(id, tag.id) &&
Objects.equals(name, tag.name)
;
return Objects.equals(this.id, tag.id) &&
Objects.equals(this.name, tag.name);
}
@Override
@@ -79,7 +86,7 @@ public class Tag {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}

View File

@@ -2,7 +2,6 @@ package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -10,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-11T21:48:33.457Z")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:23.375+08:00")
public class User {
private Long id = null;
@@ -25,8 +24,13 @@ public class User {
/**
**/
public User id(Long id) {
this.id = id;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
public Long getId() {
return id;
@@ -38,8 +42,13 @@ public class User {
/**
**/
public User username(String username) {
this.username = username;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("username")
public String getUsername() {
return username;
@@ -51,8 +60,13 @@ public class User {
/**
**/
public User firstName(String firstName) {
this.firstName = firstName;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("firstName")
public String getFirstName() {
return firstName;
@@ -64,8 +78,13 @@ public class User {
/**
**/
public User lastName(String lastName) {
this.lastName = lastName;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("lastName")
public String getLastName() {
return lastName;
@@ -77,8 +96,13 @@ public class User {
/**
**/
public User email(String email) {
this.email = email;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("email")
public String getEmail() {
return email;
@@ -90,8 +114,13 @@ public class User {
/**
**/
public User password(String password) {
this.password = password;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("password")
public String getPassword() {
return password;
@@ -103,8 +132,13 @@ public class User {
/**
**/
public User phone(String phone) {
this.phone = phone;
return this;
}
@ApiModelProperty(value = "")
@ApiModelProperty(example = "null", value = "")
@JsonProperty("phone")
public String getPhone() {
return phone;
@@ -117,8 +151,13 @@ public class User {
/**
* User Status
**/
public User userStatus(Integer userStatus) {
this.userStatus = userStatus;
return this;
}
@ApiModelProperty(value = "User Status")
@ApiModelProperty(example = "null", value = "User Status")
@JsonProperty("userStatus")
public Integer getUserStatus() {
return userStatus;
@@ -130,7 +169,7 @@ public class User {
@Override
public boolean equals(Object o) {
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
@@ -138,16 +177,14 @@ public class User {
return false;
}
User user = (User) o;
return true && Objects.equals(id, user.id) &&
Objects.equals(username, user.username) &&
Objects.equals(firstName, user.firstName) &&
Objects.equals(lastName, user.lastName) &&
Objects.equals(email, user.email) &&
Objects.equals(password, user.password) &&
Objects.equals(phone, user.phone) &&
Objects.equals(userStatus, user.userStatus)
;
return Objects.equals(this.id, user.id) &&
Objects.equals(this.username, user.username) &&
Objects.equals(this.firstName, user.firstName) &&
Objects.equals(this.lastName, user.lastName) &&
Objects.equals(this.email, user.email) &&
Objects.equals(this.password, user.password) &&
Objects.equals(this.phone, user.phone) &&
Objects.equals(this.userStatus, user.userStatus);
}
@Override
@@ -176,7 +213,7 @@ public class User {
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}