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

@@ -20,7 +20,7 @@ mvn deploy
Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information.
After the client libarary is installed/deployed, you can use it in your Maven project by adding the following to your *pom.xml*:
After the client library is installed/deployed, you can use it in your Maven project by adding the following to your *pom.xml*:
```xml
<dependency>

View File

@@ -1,3 +1,6 @@
apply plugin: 'idea'
apply plugin: 'eclipse'
group = 'io.swagger'
version = '1.0.0'
@@ -105,7 +108,9 @@ dependencies {
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:2.1.5"
compile "joda-time:joda-time:$jodatime_version"
compile "com.brsanthu:migbase64:2.2"
testCompile "junit:junit:$junit_version"
}

View File

@@ -41,7 +41,7 @@ import io.swagger.client.auth.HttpBasicAuth;
import io.swagger.client.auth.ApiKeyAuth;
import io.swagger.client.auth.OAuth;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-15T19:19:23.415+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-18T20:04:40.386+08:00")
public class ApiClient {
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
private String basePath = "http://petstore.swagger.io/v2";
@@ -49,7 +49,7 @@ public class ApiClient {
private int connectionTimeout = 0;
private Client httpClient;
private ObjectMapper mapper;
private ObjectMapper objectMapper;
private Map<String, Authentication> authentications;
@@ -59,24 +59,16 @@ public class ApiClient {
private DateFormat dateFormat;
public ApiClient() {
mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
mapper.registerModule(new JodaModule());
objectMapper = new ObjectMapper();
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
objectMapper.registerModule(new JodaModule());
objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat());
httpClient = buildHttpClient(debugging);
// Use RFC3339 format for date and datetime.
// See http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14
this.dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
// Use UTC as the default time zone.
this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
this.mapper.setDateFormat((DateFormat) dateFormat.clone());
dateFormat = ApiClient.buildDefaultDateFormat();
// Set default User-Agent.
setUserAgent("Java-Swagger");
@@ -84,9 +76,69 @@ public class ApiClient {
// Setup authentications (key: authentication name, value: authentication).
authentications = new HashMap<String, Authentication>();
authentications.put("petstore_auth", new OAuth());
authentications.put("test_api_client_id", new ApiKeyAuth("header", "x-test_api_client_id"));
authentications.put("test_api_client_secret", new ApiKeyAuth("header", "x-test_api_client_secret"));
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
authentications.put("test_api_key_query", new ApiKeyAuth("query", "test_api_key_query"));
authentications.put("test_api_key_header", new ApiKeyAuth("header", "test_api_key_header"));
// Prevent the authentications from being modified.
authentications = Collections.unmodifiableMap(authentications);
rebuildHttpClient();
}
public static DateFormat buildDefaultDateFormat() {
// Use RFC3339 format for date and datetime.
// See http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
// Use UTC as the default time zone.
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
return dateFormat;
}
/**
* Build the Client used to make HTTP requests with the latest settings,
* i.e. objectMapper and debugging.
* TODO: better to use the Builder Pattern?
*/
public ApiClient rebuildHttpClient() {
// Add the JSON serialization support to Jersey
JacksonJsonProvider jsonProvider = new JacksonJsonProvider(objectMapper);
DefaultClientConfig conf = new DefaultClientConfig();
conf.getSingletons().add(jsonProvider);
Client client = Client.create(conf);
if (debugging) {
client.addFilter(new LoggingFilter());
}
this.httpClient = client;
return this;
}
/**
* Returns the current object mapper used for JSON serialization/deserialization.
* <p>
* Note: If you make changes to the object mapper, remember to set it back via
* <code>setObjectMapper</code> in order to trigger HTTP client rebuilding.
* </p>
*/
public ObjectMapper getObjectMapper() {
return objectMapper;
}
public ApiClient setObjectMapper(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
// Need to rebuild the Client as it depends on object mapper.
rebuildHttpClient();
return this;
}
public Client getHttpClient() {
return httpClient;
}
public ApiClient setHttpClient(Client httpClient) {
this.httpClient = httpClient;
return this;
}
public String getBasePath() {
@@ -227,8 +279,8 @@ public class ApiClient {
*/
public ApiClient setDebugging(boolean debugging) {
this.debugging = debugging;
// Rebuild HTTP Client according to the new "debugging" value.
this.httpClient = buildHttpClient(debugging);
// Need to rebuild the Client as it depends on the value of debugging.
rebuildHttpClient();
return this;
}
@@ -262,8 +314,10 @@ public class ApiClient {
*/
public ApiClient setDateFormat(DateFormat dateFormat) {
this.dateFormat = dateFormat;
// also set the date format for model (de)serialization with Date properties
this.mapper.setDateFormat((DateFormat) dateFormat.clone());
// Also set the date format for model (de)serialization with Date properties.
this.objectMapper.setDateFormat((DateFormat) dateFormat.clone());
// Need to rebuild the Client as objectMapper changes.
rebuildHttpClient();
return this;
}
@@ -516,7 +570,10 @@ public class ApiClient {
response = builder.type(contentType).put(ClientResponse.class, serialize(body, contentType, formParams));
} else if ("DELETE".equals(method)) {
response = builder.type(contentType).delete(ClientResponse.class, serialize(body, contentType, formParams));
} else {
} else if ("PATCH".equals(method)) {
response = builder.type(contentType).header("X-HTTP-Method-Override", "PATCH").post(ClientResponse.class, serialize(body, contentType, formParams));
}
else {
throw new ApiException(500, "unknown method type " + method);
}
return response;
@@ -607,19 +664,4 @@ public class ApiClient {
return encodedFormParams;
}
/**
* Build the Client used to make HTTP requests.
*/
private Client buildHttpClient(boolean debugging) {
// Add the JSON serialization support to Jersey
JacksonJsonProvider jsonProvider = new JacksonJsonProvider(mapper);
DefaultClientConfig conf = new DefaultClientConfig();
conf.getSingletons().add(jsonProvider);
Client client = Client.create(conf);
if (debugging) {
client.addFilter(new LoggingFilter());
}
return client;
}
}

View File

@@ -3,7 +3,7 @@ package io.swagger.client;
import java.util.Map;
import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T14:39:16.440+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-12T18:48:10.013-08:00")
public class ApiException extends Exception {
private int code = 0;
private Map<String, List<String>> responseHeaders = null;

View File

@@ -1,6 +1,6 @@
package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T14:39:16.440+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-12T18:48:10.013-08:00")
public class Configuration {
private static ApiClient defaultApiClient = new ApiClient();

View File

@@ -1,6 +1,6 @@
package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T14:39:16.440+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-12T18:48:10.013-08:00")
public class Pair {
private String name = "";
private String value = "";

View File

@@ -1,6 +1,6 @@
package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T14:39:16.440+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-12T18:48:10.013-08:00")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).

View File

@@ -15,7 +15,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-15T19:19:23.415+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:20.498+08:00")
public class PetApi {
private ApiClient apiClient;
@@ -241,7 +241,7 @@ public class PetApi {
};
final String contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "api_key" };
String[] authNames = new String[] { "petstore_auth", "api_key" };
GenericType<Pet> returnType = new GenericType<Pet>() {};
@@ -441,7 +441,7 @@ public class PetApi {
};
final String contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "api_key" };
String[] authNames = new String[] { "petstore_auth", "api_key" };
GenericType<byte[]> returnType = new GenericType<byte[]>() {};

View File

@@ -14,7 +14,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T14:39:16.440+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:20.498+08:00")
public class StoreApi {
private ApiClient apiClient;
@@ -108,7 +108,7 @@ public class StoreApi {
};
final String contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { };
String[] authNames = new String[] { "test_api_client_id", "test_api_client_secret" };
GenericType<Order> returnType = new GenericType<Order>() {};
@@ -155,7 +155,7 @@ public class StoreApi {
};
final String contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { };
String[] authNames = new String[] { "test_api_key_query", "test_api_key_header" };
GenericType<Order> returnType = new GenericType<Order>() {};

View File

@@ -14,7 +14,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T14:39:16.440+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-12T18:48:10.013-08:00")
public class UserApi {
private ApiClient apiClient;

View File

@@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map;
import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T14:39:16.440+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-12T18:48:10.013-08:00")
public class ApiKeyAuth implements Authentication {
private final String location;
private final String paramName;

View File

@@ -9,7 +9,7 @@ import java.util.List;
import java.io.UnsupportedEncodingException;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T14:39:16.440+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-12T18:48:10.013-08:00")
public class HttpBasicAuth implements Authentication {
private String username;
private String password;

View File

@@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map;
import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T14:39:16.440+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-12T18:48:10.013-08:00")
public class OAuth implements Authentication {
private String accessToken;

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-15T19:19:23.415+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:20.498+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;
@@ -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

View File

@@ -11,7 +11,7 @@ import java.util.Date;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-15T19:19:23.415+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:20.498+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;
@@ -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

View File

@@ -14,7 +14,7 @@ import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-15T19:19:23.415+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:20.498+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;
@@ -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

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-15T19:19:23.415+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:20.498+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;
@@ -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

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-15T19:19:23.415+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:20.498+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;
@@ -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

View File

@@ -85,7 +85,7 @@ public class PetstoreProfiling {
private void writeResultsToFile(List<Map<String, String>> results) {
try {
File file = new File(outputFile);
java.io.File file = new java.io.File(outputFile);
PrintWriter writer = new PrintWriter(file);
String command = "mvn compile test-compile exec:java -Dexec.classpathScope=test -Dexec.mainClass=\"io.swagger.PetstoreProfiling\"";
writer.println("# To run the profiling:");

View File

@@ -131,7 +131,13 @@ public class ApiClientTest {
@Test
public void testSetApiKeyAndPrefix() {
ApiKeyAuth auth = (ApiKeyAuth) apiClient.getAuthentications().get("api_key");
ApiKeyAuth auth = null;
for (Authentication _auth : apiClient.getAuthentications().values()) {
if (_auth instanceof ApiKeyAuth) {
auth = (ApiKeyAuth) _auth;
break;
}
}
auth.setApiKey(null);
auth.setApiKeyPrefix(null);