Merge remote-tracking branch 'origin' into sync_master_230

This commit is contained in:
wing328
2017-02-10 23:31:36 +08:00
1480 changed files with 60531 additions and 12438 deletions

View File

@@ -6,8 +6,10 @@
<packaging>jar</packaging>
<name>swagger-petstore-feign</name>
<version>1.0.0</version>
<url>https://github.com/swagger-api/swagger-codegen</url>
<description>Swagger Java</description>
<scm>
<connection>scm:git:git@github.com:swagger-api/swagger-mustache.git</connection>
<connection>scm:git:git@github.com:swagger-api/swagger-codegen.git</connection>
<developerConnection>scm:git:git@github.com:swagger-api/swagger-codegen.git</developerConnection>
<url>https://github.com/swagger-api/swagger-codegen</url>
</scm>
@@ -23,6 +25,15 @@
</license>
</licenses>
<developers>
<developer>
<name>Swagger</name>
<email>apiteam@swagger.io</email>
<organization>Swagger</organization>
<organizationUrl>http://swagger.io</organizationUrl>
</developer>
</developers>
<build>
<plugins>
<plugin>
@@ -107,9 +118,55 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign-artifacts</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>

View File

@@ -43,11 +43,11 @@ public class ApiClient {
this();
for(String authName : authNames) {
RequestInterceptor auth;
if (authName == "api_key") {
if ("api_key".equals(authName)) {
auth = new ApiKeyAuth("header", "api_key");
} else if (authName == "http_basic_test") {
} else if ("http_basic_test".equals(authName)) {
auth = new HttpBasicAuth();
} else if (authName == "petstore_auth") {
} else if ("petstore_auth".equals(authName)) {
auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
} else {
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
@@ -155,6 +155,9 @@ public class ApiClient {
* apiClient.setBasePath("http://localhost:8080");
* XYZApi api = apiClient.buildClient(XYZApi.class);
* XYZResponse response = api.someMethod(...);
* @param <T> Type
* @param clientClass Client class
* @return The Client
*/
public <T extends Api> T buildClient(Class<T> clientClass) {
return feignBuilder.target(clientClass, basePath);
@@ -192,7 +195,7 @@ public class ApiClient {
/**
* Helper method to configure the first api key found
* @param apiKey
* @param apiKey API key
*/
public void setApiKey(String apiKey) {
for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) {
@@ -207,8 +210,8 @@ public class ApiClient {
/**
* Helper method to configure the username/password for basic auth or password OAuth
* @param username
* @param password
* @param username Username
* @param password Password
*/
public void setCredentials(String username, String password) {
for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) {
@@ -228,7 +231,7 @@ public class ApiClient {
/**
* Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one)
* @return
* @return Token request builder
*/
public TokenRequestBuilder getTokenEndPoint() {
for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) {
@@ -242,7 +245,7 @@ public class ApiClient {
/**
* Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one)
* @return
* @return Authentication request builder
*/
public AuthenticationRequestBuilder getAuthorizationEndPoint() {
for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) {
@@ -256,8 +259,8 @@ public class ApiClient {
/**
* Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one)
* @param accessToken
* @param expiresIn : validity period in seconds
* @param accessToken Access Token
* @param expiresIn Validity period in seconds
*/
public void setAccessToken(String accessToken, Long expiresIn) {
for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) {
@@ -271,9 +274,9 @@ public class ApiClient {
/**
* Helper method to configure the oauth accessCode/implicit flow parameters
* @param clientId
* @param clientSecret
* @param redirectURI
* @param clientId Client ID
* @param clientSecret Client secret
* @param redirectURI Redirect URI
*/
public void configureAuthorizationFlow(String clientId, String clientSecret, String redirectURI) {
for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) {
@@ -293,7 +296,7 @@ public class ApiClient {
/**
* Configures a listener which is notified when a new access token is received.
* @param accessTokenListener
* @param accessTokenListener Acesss token listener
*/
public void registerAccessTokenListener(AccessTokenListener accessTokenListener) {
for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) {
@@ -305,14 +308,19 @@ public class ApiClient {
}
}
/**
* Gets request interceptor based on authentication name
* @param authName Authentiation name
* @return Request Interceptor
*/
public RequestInterceptor getAuthorization(String authName) {
return apiAuthorizations.get(authName);
}
/**
* Adds an authorization to be used by the client
* @param authName
* @param authorization
* @param authName Authentication name
* @param authorization Request interceptor
*/
public void addAuthorization(String authName, RequestInterceptor authorization) {
if (apiAuthorizations.containsKey(authName)) {

View File

@@ -20,7 +20,7 @@ public interface FakeApi extends ApiClient.Api {
/**
* To test \&quot;client\&quot; model
* To test \&quot;client\&quot; model
* @param body client model (required)
* @param body client model (required)
* @return Client
*/
@RequestLine("PATCH /fake")
@@ -33,21 +33,20 @@ public interface FakeApi extends ApiClient.Api {
/**
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* @param number None (required)
* @param _double None (required)
* @param patternWithoutDelimiter None (required)
* @param _byte None (required)
* @param integer None (optional)
* @param int32 None (optional)
* @param int64 None (optional)
* @param _float None (optional)
* @param string None (optional)
* @param binary None (optional)
* @param date None (optional)
* @param dateTime None (optional)
* @param password None (optional)
* @param paramCallback None (optional)
* @return void
* @param number None (required)
* @param _double None (required)
* @param patternWithoutDelimiter None (required)
* @param _byte None (required)
* @param integer None (optional)
* @param int32 None (optional)
* @param int64 None (optional)
* @param _float None (optional)
* @param string None (optional)
* @param binary None (optional)
* @param date None (optional)
* @param dateTime None (optional)
* @param password None (optional)
* @param paramCallback None (optional)
*/
@RequestLine("POST /fake")
@Headers({
@@ -59,15 +58,14 @@ public interface FakeApi extends ApiClient.Api {
/**
* To test enum parameters
* To test enum parameters
* @param enumFormStringArray Form parameter enum test (string array) (optional)
* @param enumFormString Form parameter enum test (string) (optional, default to -efg)
* @param enumHeaderStringArray Header parameter enum test (string array) (optional)
* @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
* @param enumQueryStringArray Query parameter enum test (string array) (optional)
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
* @param enumQueryInteger Query parameter enum test (double) (optional)
* @param enumQueryDouble Query parameter enum test (double) (optional)
* @return void
* @param enumFormStringArray Form parameter enum test (string array) (optional)
* @param enumFormString Form parameter enum test (string) (optional, default to -efg)
* @param enumHeaderStringArray Header parameter enum test (string array) (optional)
* @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
* @param enumQueryStringArray Query parameter enum test (string array) (optional)
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
* @param enumQueryInteger Query parameter enum test (double) (optional)
* @param enumQueryDouble Query parameter enum test (double) (optional)
*/
@RequestLine("GET /fake?enum_query_string_array={enumQueryStringArray}&enum_query_string={enumQueryString}&enum_query_integer={enumQueryInteger}")
@Headers({

View File

@@ -1,29 +0,0 @@
package io.swagger.client.api;
import io.swagger.client.ApiClient;
import io.swagger.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import feign.*;
public interface Fake_classname_tags123Api extends ApiClient.Api {
/**
* To test class name in snake case
*
* @param body client model (required)
* @return Client
*/
@RequestLine("PATCH /fake_classname_test")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
Client testClassname(Client body);
}

View File

@@ -19,8 +19,7 @@ public interface PetApi extends ApiClient.Api {
/**
* Add a new pet to the store
*
* @param body Pet object that needs to be added to the store (required)
* @return void
* @param body Pet object that needs to be added to the store (required)
*/
@RequestLine("POST /pet")
@Headers({
@@ -32,9 +31,8 @@ public interface PetApi extends ApiClient.Api {
/**
* Deletes a pet
*
* @param petId Pet id to delete (required)
* @param apiKey (optional)
* @return void
* @param petId Pet id to delete (required)
* @param apiKey (optional)
*/
@RequestLine("DELETE /pet/{petId}")
@Headers({
@@ -47,8 +45,8 @@ public interface PetApi extends ApiClient.Api {
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter (required)
* @return List<Pet>
* @param status Status values that need to be considered for filter (required)
* @return List&lt;Pet&gt;
*/
@RequestLine("GET /pet/findByStatus?status={status}")
@Headers({
@@ -60,8 +58,8 @@ public interface PetApi extends ApiClient.Api {
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by (required)
* @return List<Pet>
* @param tags Tags to filter by (required)
* @return List&lt;Pet&gt;
*/
@RequestLine("GET /pet/findByTags?tags={tags}")
@Headers({
@@ -73,7 +71,7 @@ public interface PetApi extends ApiClient.Api {
/**
* Find pet by ID
* Returns a single pet
* @param petId ID of pet to return (required)
* @param petId ID of pet to return (required)
* @return Pet
*/
@RequestLine("GET /pet/{petId}")
@@ -86,8 +84,7 @@ public interface PetApi extends ApiClient.Api {
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store (required)
* @return void
* @param body Pet object that needs to be added to the store (required)
*/
@RequestLine("PUT /pet")
@Headers({
@@ -99,10 +96,9 @@ public interface PetApi extends ApiClient.Api {
/**
* Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated (required)
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return void
* @param petId ID of pet that needs to be updated (required)
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
*/
@RequestLine("POST /pet/{petId}")
@Headers({
@@ -114,9 +110,9 @@ public interface PetApi extends ApiClient.Api {
/**
* uploads an image
*
* @param petId ID of pet to update (required)
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @param petId ID of pet to update (required)
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return ModelApiResponse
*/
@RequestLine("POST /pet/{petId}/uploadImage")

View File

@@ -17,8 +17,7 @@ public interface StoreApi extends ApiClient.Api {
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted (required)
* @return void
* @param orderId ID of the order that needs to be deleted (required)
*/
@RequestLine("DELETE /store/order/{orderId}")
@Headers({
@@ -30,7 +29,7 @@ public interface StoreApi extends ApiClient.Api {
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return Map<String, Integer>
* @return Map&lt;String, Integer&gt;
*/
@RequestLine("GET /store/inventory")
@Headers({
@@ -42,7 +41,7 @@ public interface StoreApi extends ApiClient.Api {
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched (required)
* @param orderId ID of pet that needs to be fetched (required)
* @return Order
*/
@RequestLine("GET /store/order/{orderId}")
@@ -55,7 +54,7 @@ public interface StoreApi extends ApiClient.Api {
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet (required)
* @param body order placed for purchasing the pet (required)
* @return Order
*/
@RequestLine("POST /store/order")

View File

@@ -17,8 +17,7 @@ public interface UserApi extends ApiClient.Api {
/**
* Create user
* This can only be done by the logged in user.
* @param body Created user object (required)
* @return void
* @param body Created user object (required)
*/
@RequestLine("POST /user")
@Headers({
@@ -30,8 +29,7 @@ public interface UserApi extends ApiClient.Api {
/**
* Creates list of users with given input array
*
* @param body List of user object (required)
* @return void
* @param body List of user object (required)
*/
@RequestLine("POST /user/createWithArray")
@Headers({
@@ -43,8 +41,7 @@ public interface UserApi extends ApiClient.Api {
/**
* Creates list of users with given input array
*
* @param body List of user object (required)
* @return void
* @param body List of user object (required)
*/
@RequestLine("POST /user/createWithList")
@Headers({
@@ -56,8 +53,7 @@ public interface UserApi extends ApiClient.Api {
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted (required)
* @return void
* @param username The name that needs to be deleted (required)
*/
@RequestLine("DELETE /user/{username}")
@Headers({
@@ -69,7 +65,7 @@ public interface UserApi extends ApiClient.Api {
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing. (required)
* @param username The name that needs to be fetched. Use user1 for testing. (required)
* @return User
*/
@RequestLine("GET /user/{username}")
@@ -82,8 +78,8 @@ public interface UserApi extends ApiClient.Api {
/**
* Logs user into the system
*
* @param username The user name for login (required)
* @param password The password for login in clear text (required)
* @param username The user name for login (required)
* @param password The password for login in clear text (required)
* @return String
*/
@RequestLine("GET /user/login?username={username}&password={password}")
@@ -96,7 +92,6 @@ public interface UserApi extends ApiClient.Api {
/**
* Logs out current logged in user session
*
* @return void
*/
@RequestLine("GET /user/logout")
@Headers({
@@ -108,9 +103,8 @@ public interface UserApi extends ApiClient.Api {
/**
* Updated user
* This can only be done by the logged in user.
* @param username name that need to be deleted (required)
* @param body Updated user object (required)
* @return void
* @param username name that need to be deleted (required)
* @param body Updated user object (required)
*/
@RequestLine("PUT /user/{username}")
@Headers({

View File

@@ -24,10 +24,12 @@ import io.swagger.annotations.ApiModelProperty;
/**
* Animal
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className" )
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
})
public class Animal {
@JsonProperty("className")
private String className = null;

View File

@@ -0,0 +1,204 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Capitalization
*/
public class Capitalization {
@JsonProperty("smallCamel")
private String smallCamel = null;
@JsonProperty("CapitalCamel")
private String capitalCamel = null;
@JsonProperty("small_Snake")
private String smallSnake = null;
@JsonProperty("Capital_Snake")
private String capitalSnake = null;
@JsonProperty("SCA_ETH_Flow_Points")
private String scAETHFlowPoints = null;
@JsonProperty("ATT_NAME")
private String ATT_NAME = null;
public Capitalization smallCamel(String smallCamel) {
this.smallCamel = smallCamel;
return this;
}
/**
* Get smallCamel
* @return smallCamel
**/
@ApiModelProperty(example = "null", value = "")
public String getSmallCamel() {
return smallCamel;
}
public void setSmallCamel(String smallCamel) {
this.smallCamel = smallCamel;
}
public Capitalization capitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
return this;
}
/**
* Get capitalCamel
* @return capitalCamel
**/
@ApiModelProperty(example = "null", value = "")
public String getCapitalCamel() {
return capitalCamel;
}
public void setCapitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
}
public Capitalization smallSnake(String smallSnake) {
this.smallSnake = smallSnake;
return this;
}
/**
* Get smallSnake
* @return smallSnake
**/
@ApiModelProperty(example = "null", value = "")
public String getSmallSnake() {
return smallSnake;
}
public void setSmallSnake(String smallSnake) {
this.smallSnake = smallSnake;
}
public Capitalization capitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
return this;
}
/**
* Get capitalSnake
* @return capitalSnake
**/
@ApiModelProperty(example = "null", value = "")
public String getCapitalSnake() {
return capitalSnake;
}
public void setCapitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
}
public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
return this;
}
/**
* Get scAETHFlowPoints
* @return scAETHFlowPoints
**/
@ApiModelProperty(example = "null", value = "")
public String getScAETHFlowPoints() {
return scAETHFlowPoints;
}
public void setScAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
}
public Capitalization ATT_NAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
return this;
}
/**
* Name of the pet
* @return ATT_NAME
**/
@ApiModelProperty(example = "null", value = "Name of the pet ")
public String getATTNAME() {
return ATT_NAME;
}
public void setATTNAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Capitalization capitalization = (Capitalization) o;
return Objects.equals(this.smallCamel, capitalization.smallCamel) &&
Objects.equals(this.capitalCamel, capitalization.capitalCamel) &&
Objects.equals(this.smallSnake, capitalization.smallSnake) &&
Objects.equals(this.capitalSnake, capitalization.capitalSnake) &&
Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) &&
Objects.equals(this.ATT_NAME, capitalization.ATT_NAME);
}
@Override
public int hashCode() {
return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Capitalization {\n");
sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n");
sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n");
sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n");
sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n");
sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n");
sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -31,7 +31,9 @@ public class EnumTest {
public enum EnumStringEnum {
UPPER("UPPER"),
LOWER("lower");
LOWER("lower"),
EMPTY("");
private String value;

View File

@@ -0,0 +1,15 @@
# Capitalization
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**smallCamel** | **String** | | [optional]
**capitalCamel** | **String** | | [optional]
**smallSnake** | **String** | | [optional]
**capitalSnake** | **String** | | [optional]
**scAETHFlowPoints** | **String** | | [optional]
**ATT_NAME** | **String** | Name of the pet | [optional]

View File

@@ -16,6 +16,7 @@ Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;
EMPTY | &quot;&quot;
<a name="EnumIntegerEnum"></a>

View File

@@ -6,7 +6,13 @@
<packaging>jar</packaging>
<name>swagger-java-client</name>
<version>1.0.0</version>
<url>https://github.com/swagger-api/swagger-codegen</url>
<description>Swagger Java</description>
<scm>
<connection>scm:git:git@github.com:swagger-api/swagger-codegen.git</connection>
<developerConnection>scm:git:git@github.com:swagger-api/swagger-codegen.git</developerConnection>
<url>https://github.com/swagger-api/swagger-codegen</url>
</scm>
<prerequisites>
<maven>2.2.0</maven>
</prerequisites>
@@ -19,6 +25,15 @@
</license>
</licenses>
<developers>
<developer>
<name>Swagger</name>
<email>apiteam@swagger.io</email>
<organization>Swagger</organization>
<organizationUrl>http://swagger.io</organizationUrl>
</developer>
</developers>
<build>
<plugins>
<plugin>
@@ -113,9 +128,55 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign-artifacts</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>

View File

@@ -109,6 +109,7 @@ public class ApiClient {
* Build the Client used to make HTTP requests with the latest settings,
* i.e. objectMapper and debugging.
* TODO: better to use the Builder Pattern?
* @return API client
*/
public ApiClient rebuildHttpClient() {
// Add the JSON serialization support to Jersey
@@ -129,6 +130,7 @@ public class ApiClient {
* 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>
* @return Object mapper
*/
public ObjectMapper getObjectMapper() {
return objectMapper;
@@ -161,6 +163,7 @@ public class ApiClient {
/**
* Gets the status code of the previous request
* @return Status code
*/
public int getStatusCode() {
return statusCode;
@@ -168,6 +171,7 @@ public class ApiClient {
/**
* Gets the response headers of the previous request
* @return Response headers
*/
public Map<String, List<String>> getResponseHeaders() {
return responseHeaders;
@@ -175,6 +179,7 @@ public class ApiClient {
/**
* Get authentications (key: authentication name, value: authentication).
* @return Map of authentication
*/
public Map<String, Authentication> getAuthentications() {
return authentications;
@@ -192,6 +197,7 @@ public class ApiClient {
/**
* Helper method to set username for the first HTTP basic authentication.
* @param username Username
*/
public void setUsername(String username) {
for (Authentication auth : authentications.values()) {
@@ -205,6 +211,7 @@ public class ApiClient {
/**
* Helper method to set password for the first HTTP basic authentication.
* @param password Password
*/
public void setPassword(String password) {
for (Authentication auth : authentications.values()) {
@@ -218,6 +225,7 @@ public class ApiClient {
/**
* Helper method to set API key value for the first API key authentication.
* @param apiKey API key
*/
public void setApiKey(String apiKey) {
for (Authentication auth : authentications.values()) {
@@ -231,6 +239,7 @@ public class ApiClient {
/**
* Helper method to set API key prefix for the first API key authentication.
* @param apiKeyPrefix API key prefix
*/
public void setApiKeyPrefix(String apiKeyPrefix) {
for (Authentication auth : authentications.values()) {
@@ -244,6 +253,7 @@ public class ApiClient {
/**
* Helper method to set access token for the first OAuth2 authentication.
* @param accessToken Access token
*/
public void setAccessToken(String accessToken) {
for (Authentication auth : authentications.values()) {
@@ -257,6 +267,8 @@ public class ApiClient {
/**
* Set the User-Agent header's value (by adding to the default header map).
* @param userAgent User agent
* @return API client
*/
public ApiClient setUserAgent(String userAgent) {
addDefaultHeader("User-Agent", userAgent);
@@ -268,6 +280,7 @@ public class ApiClient {
*
* @param key The header's key
* @param value The header's value
* @return API client
*/
public ApiClient addDefaultHeader(String key, String value) {
defaultHeaderMap.put(key, value);
@@ -276,6 +289,7 @@ public class ApiClient {
/**
* Check that whether debugging is enabled for this API client.
* @return True if debugging is on
*/
public boolean isDebugging() {
return debugging;
@@ -285,6 +299,7 @@ public class ApiClient {
* Enable/disable debugging for this API client.
*
* @param debugging To enable (true) or disable (false) debugging
* @return API client
*/
public ApiClient setDebugging(boolean debugging) {
this.debugging = debugging;
@@ -295,6 +310,7 @@ public class ApiClient {
/**
* Connect timeout (in milliseconds).
* @return Connection timeout
*/
public int getConnectTimeout() {
return connectionTimeout;
@@ -304,6 +320,8 @@ public class ApiClient {
* Set the connect timeout (in milliseconds).
* A value of 0 means no timeout, otherwise values must be between 1 and
* {@link Integer#MAX_VALUE}.
* @param connectionTimeout Connection timeout in milliseconds
* @return API client
*/
public ApiClient setConnectTimeout(int connectionTimeout) {
this.connectionTimeout = connectionTimeout;
@@ -313,6 +331,7 @@ public class ApiClient {
/**
* Get the date format used to parse/format date parameters.
* @return Date format
*/
public DateFormat getDateFormat() {
return dateFormat;
@@ -320,6 +339,8 @@ public class ApiClient {
/**
* Set the date format used to parse/format date parameters.
* @param dateFormat Date format
* @return API client
*/
public ApiClient setDateFormat(DateFormat dateFormat) {
this.dateFormat = dateFormat;
@@ -332,6 +353,8 @@ public class ApiClient {
/**
* Parse the given string into Date object.
* @param str String
* @return Date
*/
public Date parseDate(String str) {
try {
@@ -343,6 +366,8 @@ public class ApiClient {
/**
* Format the given Date object into string.
* @param date Date
* @return Date in string format
*/
public String formatDate(Date date) {
return dateFormat.format(date);
@@ -350,6 +375,8 @@ public class ApiClient {
/**
* Format the given parameter object into string.
* @param param Object
* @return Object in string format
*/
public String parameterToString(Object param) {
if (param == null) {
@@ -371,8 +398,12 @@ public class ApiClient {
}
/*
Format to {@code Pair} objects.
*/
* Format to {@code Pair} objects.
* @param collectionFormat Collection format
* @param name Name
* @param value Value
* @return List of pair
*/
public List<Pair> parameterToPairs(String collectionFormat, String name, Object value){
List<Pair> params = new ArrayList<Pair>();
@@ -432,6 +463,8 @@ public class ApiClient {
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* @param mime MIME
* @return True if MIME type is boolean
*/
public boolean isJsonMime(String mime) {
return mime != null && mime.matches("(?i)application\\/json(;.*)?");
@@ -481,6 +514,8 @@ public class ApiClient {
/**
* Escape the given string to be used as URL query value.
* @param str String
* @return Escaped string
*/
public String escapeString(String str) {
try {
@@ -493,6 +528,11 @@ public class ApiClient {
/**
* Serialize the given Java object into string according the given
* Content-Type (only JSON is supported for now).
* @param obj Object
* @param contentType Content type
* @param formParams Form parameters
* @return Object
* @throws ApiException API exception
*/
public Object serialize(Object obj, String contentType, Map<String, Object> formParams) throws ApiException {
if (contentType.startsWith("multipart/form-data")) {
@@ -598,6 +638,7 @@ public class ApiClient {
/**
* Invoke API by sending HTTP request with the given options.
*
* @param <T> Type
* @param path The sub-path of the HTTP URL
* @param method The request method, one of "GET", "POST", "PUT", and "DELETE"
* @param queryParams The query parameters
@@ -607,7 +648,9 @@ public class ApiClient {
* @param accept The request's Accept header
* @param contentType The request's Content-Type header
* @param authNames The authentications to apply
* @param returnType Return type
* @return The response body in type of string
* @throws ApiException API exception
*/
public <T> T invokeAPI(String path, String method, List<Pair> queryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String accept, String contentType, String[] authNames, GenericType<T> returnType) throws ApiException {
@@ -646,6 +689,8 @@ public class ApiClient {
* Update query and header parameters based on authentication settings.
*
* @param authNames The authentications to apply
* @param queryParams Query parameters
* @param headerParams Header parameters
*/
private void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams) {
for (String authName : authNames) {
@@ -657,6 +702,8 @@ public class ApiClient {
/**
* Encode the given form parameters as request body.
* @param formParams Form parameters
* @return HTTP form encoded parameters
*/
private String getXWWWFormUrlencodedParams(Map<String, Object> formParams) {
StringBuilder formParamBuilder = new StringBuilder();

View File

@@ -1,92 +0,0 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.api;
import com.sun.jersey.api.client.GenericType;
import io.swagger.client.ApiException;
import io.swagger.client.ApiClient;
import io.swagger.client.Configuration;
import io.swagger.client.model.*;
import io.swagger.client.Pair;
import io.swagger.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Fake_classname_tags123Api {
private ApiClient apiClient;
public Fake_classname_tags123Api() {
this(Configuration.getDefaultApiClient());
}
public Fake_classname_tags123Api(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* To test class name in snake case
*
* @param body client model (required)
* @return Client
* @throws ApiException if fails to make API call
*/
public Client testClassname(Client body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling testClassname");
}
// create path and map variables
String localVarPath = "/fake_classname_test".replaceAll("\\{format\\}","json");
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType<Client> localVarReturnType = new GenericType<Client>() {};
return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
}

View File

@@ -138,7 +138,7 @@ public class PetApi {
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter (required)
* @return List<Pet>
* @return List&lt;Pet&gt;
* @throws ApiException if fails to make API call
*/
public List<Pet> findPetsByStatus(List<String> status) throws ApiException {
@@ -180,7 +180,7 @@ public class PetApi {
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by (required)
* @return List<Pet>
* @return List&lt;Pet&gt;
* @throws ApiException if fails to make API call
*/
public List<Pet> findPetsByTags(List<String> tags) throws ApiException {

View File

@@ -92,7 +92,7 @@ public class StoreApi {
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return Map<String, Integer>
* @return Map&lt;String, Integer&gt;
* @throws ApiException if fails to make API call
*/
public Map<String, Integer> getInventory() throws ApiException {

View File

@@ -24,10 +24,12 @@ import io.swagger.annotations.ApiModelProperty;
/**
* Animal
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className" )
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
})
public class Animal {
@JsonProperty("className")
private String className = null;

View File

@@ -0,0 +1,204 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Capitalization
*/
public class Capitalization {
@JsonProperty("smallCamel")
private String smallCamel = null;
@JsonProperty("CapitalCamel")
private String capitalCamel = null;
@JsonProperty("small_Snake")
private String smallSnake = null;
@JsonProperty("Capital_Snake")
private String capitalSnake = null;
@JsonProperty("SCA_ETH_Flow_Points")
private String scAETHFlowPoints = null;
@JsonProperty("ATT_NAME")
private String ATT_NAME = null;
public Capitalization smallCamel(String smallCamel) {
this.smallCamel = smallCamel;
return this;
}
/**
* Get smallCamel
* @return smallCamel
**/
@ApiModelProperty(example = "null", value = "")
public String getSmallCamel() {
return smallCamel;
}
public void setSmallCamel(String smallCamel) {
this.smallCamel = smallCamel;
}
public Capitalization capitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
return this;
}
/**
* Get capitalCamel
* @return capitalCamel
**/
@ApiModelProperty(example = "null", value = "")
public String getCapitalCamel() {
return capitalCamel;
}
public void setCapitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
}
public Capitalization smallSnake(String smallSnake) {
this.smallSnake = smallSnake;
return this;
}
/**
* Get smallSnake
* @return smallSnake
**/
@ApiModelProperty(example = "null", value = "")
public String getSmallSnake() {
return smallSnake;
}
public void setSmallSnake(String smallSnake) {
this.smallSnake = smallSnake;
}
public Capitalization capitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
return this;
}
/**
* Get capitalSnake
* @return capitalSnake
**/
@ApiModelProperty(example = "null", value = "")
public String getCapitalSnake() {
return capitalSnake;
}
public void setCapitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
}
public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
return this;
}
/**
* Get scAETHFlowPoints
* @return scAETHFlowPoints
**/
@ApiModelProperty(example = "null", value = "")
public String getScAETHFlowPoints() {
return scAETHFlowPoints;
}
public void setScAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
}
public Capitalization ATT_NAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
return this;
}
/**
* Name of the pet
* @return ATT_NAME
**/
@ApiModelProperty(example = "null", value = "Name of the pet ")
public String getATTNAME() {
return ATT_NAME;
}
public void setATTNAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Capitalization capitalization = (Capitalization) o;
return Objects.equals(this.smallCamel, capitalization.smallCamel) &&
Objects.equals(this.capitalCamel, capitalization.capitalCamel) &&
Objects.equals(this.smallSnake, capitalization.smallSnake) &&
Objects.equals(this.capitalSnake, capitalization.capitalSnake) &&
Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) &&
Objects.equals(this.ATT_NAME, capitalization.ATT_NAME);
}
@Override
public int hashCode() {
return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Capitalization {\n");
sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n");
sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n");
sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n");
sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n");
sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n");
sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -31,7 +31,9 @@ public class EnumTest {
public enum EnumStringEnum {
UPPER("UPPER"),
LOWER("lower");
LOWER("lower"),
EMPTY("");
private String value;

View File

@@ -15,6 +15,7 @@ Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;
EMPTY | &quot;&quot;
<a name="EnumIntegerEnum"></a>

View File

@@ -0,0 +1,431 @@
<!-- ====================================================================== -->
<!-- -->
<!-- Generated by Maven Help Plugin on 2017-01-21T07:16:42 -->
<!-- See: http://maven.apache.org/plugins/maven-help-plugin/ -->
<!-- -->
<!-- ====================================================================== -->
<!-- ====================================================================== -->
<!-- -->
<!-- Effective POM for project -->
<!-- 'io.swagger:swagger-petstore-jersey2-java6:jar:1.0.0' -->
<!-- -->
<!-- ====================================================================== -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>swagger-petstore-jersey2-java6</artifactId>
<version>1.0.0</version>
<name>swagger-petstore-jersey2-java6</name>
<prerequisites>
<maven>2.2.0</maven>
</prerequisites>
<scm>
<connection>scm:git:git@github.com:swagger-api/swagger-mustache.git</connection>
<developerConnection>scm:git:git@github.com:swagger-api/swagger-codegen.git</developerConnection>
<url>https://github.com/swagger-api/swagger-codegen</url>
</scm>
<properties>
<commons_io_version>2.5</commons_io_version>
<commons_lang3_version>3.5</commons_lang3_version>
<jackson-version>2.7.5</jackson-version>
<jersey-version>2.22.2</jersey-version>
<jodatime-version>2.9.4</jodatime-version>
<junit-version>4.12</junit-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<swagger-core-version>1.5.9</swagger-core-version>
</properties>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.9</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>2.22.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>2.22.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.22.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.7.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.7.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.7.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>2.7.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.brsanthu</groupId>
<artifactId>migbase64</artifactId>
<version>2.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</pluginRepository>
</pluginRepositories>
<build>
<sourceDirectory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/jersey2-java6/src/main/java</sourceDirectory>
<scriptSourceDirectory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/jersey2-java6/src/main/scripts</scriptSourceDirectory>
<testSourceDirectory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/jersey2-java6/src/test/java</testSourceDirectory>
<outputDirectory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/jersey2-java6/target/classes</outputDirectory>
<testOutputDirectory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/jersey2-java6/target/test-classes</testOutputDirectory>
<resources>
<resource>
<directory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/jersey2-java6/src/main/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/jersey2-java6/src/test/resources</directory>
</testResource>
</testResources>
<directory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/jersey2-java6/target</directory>
<finalName>swagger-petstore-jersey2-java6-1.0.0</finalName>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<executions>
<execution>
<id>default-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<systemProperties>
<property>
<name>loggerPath</name>
<value>conf/log4j.properties</value>
</property>
</systemProperties>
<argLine>-Xms512m -Xmx1500m</argLine>
<parallel>methods</parallel>
<forkMode>pertest</forkMode>
</configuration>
</execution>
</executions>
<configuration>
<systemProperties>
<property>
<name>loggerPath</name>
<value>conf/log4j.properties</value>
</property>
</systemProperties>
<argLine>-Xms512m -Xmx1500m</argLine>
<parallel>methods</parallel>
<forkMode>pertest</forkMode>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/jersey2-java6/target/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration />
</execution>
<execution>
<goals>
<goal>jar</goal>
<goal>test-jar</goal>
</goals>
<configuration />
</execution>
</executions>
<configuration />
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.12</version>
<executions>
<execution>
<id>add_sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add_test_sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/test/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</execution>
<execution>
<id>default-testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</execution>
</executions>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>default-clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>default-testResources</id>
<phase>process-test-resources</phase>
<goals>
<goal>testResources</goal>
</goals>
</execution>
<execution>
<id>default-resources</id>
<phase>process-resources</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>default-install</id>
<phase>install</phase>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.3</version>
<executions>
<execution>
<id>default-site</id>
<phase>site</phase>
<goals>
<goal>site</goal>
</goals>
<configuration>
<outputDirectory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/jersey2-java6/target/site</outputDirectory>
<reportPlugins>
<reportPlugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
</reportPlugin>
</reportPlugins>
</configuration>
</execution>
<execution>
<id>default-deploy</id>
<phase>site-deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<outputDirectory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/jersey2-java6/target/site</outputDirectory>
<reportPlugins>
<reportPlugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
</reportPlugin>
</reportPlugins>
</configuration>
</execution>
</executions>
<configuration>
<outputDirectory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/jersey2-java6/target/site</outputDirectory>
<reportPlugins>
<reportPlugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
</reportPlugin>
</reportPlugins>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<outputDirectory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/jersey2-java6/target/site</outputDirectory>
</reporting>
</project>

View File

@@ -42,7 +42,9 @@ public class EnumTest {
public enum EnumStringEnum {
UPPER("UPPER"),
LOWER("lower");
LOWER("lower"),
EMPTY("");
private String value;

View File

@@ -0,0 +1,15 @@
# Capitalization
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**smallCamel** | **String** | | [optional]
**capitalCamel** | **String** | | [optional]
**smallSnake** | **String** | | [optional]
**capitalSnake** | **String** | | [optional]
**scAETHFlowPoints** | **String** | | [optional]
**ATT_NAME** | **String** | Name of the pet | [optional]

View File

@@ -16,6 +16,7 @@ Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;
EMPTY | &quot;&quot;
<a name="EnumIntegerEnum"></a>

View File

@@ -6,8 +6,10 @@
<packaging>jar</packaging>
<name>swagger-petstore-jersey2</name>
<version>1.0.0</version>
<url>https://github.com/swagger-api/swagger-codegen</url>
<description>Swagger Java</description>
<scm>
<connection>scm:git:git@github.com:swagger-api/swagger-mustache.git</connection>
<connection>scm:git:git@github.com:swagger-api/swagger-codegen.git</connection>
<developerConnection>scm:git:git@github.com:swagger-api/swagger-codegen.git</developerConnection>
<url>https://github.com/swagger-api/swagger-codegen</url>
</scm>
@@ -22,7 +24,16 @@
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>Swagger</name>
<email>apiteam@swagger.io</email>
<organization>Swagger</organization>
<organizationUrl>http://swagger.io</organizationUrl>
</developer>
</developers>
<build>
<plugins>
<plugin>
@@ -116,9 +127,55 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign-artifacts</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>

View File

@@ -86,6 +86,7 @@ public class ApiClient {
/**
* Gets the JSON instance to do JSON serialization and deserialization.
* @return JSON
*/
public JSON getJSON() {
return json;
@@ -111,6 +112,7 @@ public class ApiClient {
/**
* Gets the status code of the previous request
* @return Status code
*/
public int getStatusCode() {
return statusCode;
@@ -118,6 +120,7 @@ public class ApiClient {
/**
* Gets the response headers of the previous request
* @return Response headers
*/
public Map<String, List<String>> getResponseHeaders() {
return responseHeaders;
@@ -125,6 +128,7 @@ public class ApiClient {
/**
* Get authentications (key: authentication name, value: authentication).
* @return Map of authentication object
*/
public Map<String, Authentication> getAuthentications() {
return authentications;
@@ -142,6 +146,7 @@ public class ApiClient {
/**
* Helper method to set username for the first HTTP basic authentication.
* @param username Username
*/
public void setUsername(String username) {
for (Authentication auth : authentications.values()) {
@@ -155,6 +160,7 @@ public class ApiClient {
/**
* Helper method to set password for the first HTTP basic authentication.
* @param password Password
*/
public void setPassword(String password) {
for (Authentication auth : authentications.values()) {
@@ -168,6 +174,7 @@ public class ApiClient {
/**
* Helper method to set API key value for the first API key authentication.
* @param apiKey API key
*/
public void setApiKey(String apiKey) {
for (Authentication auth : authentications.values()) {
@@ -181,6 +188,7 @@ public class ApiClient {
/**
* Helper method to set API key prefix for the first API key authentication.
* @param apiKeyPrefix API key prefix
*/
public void setApiKeyPrefix(String apiKeyPrefix) {
for (Authentication auth : authentications.values()) {
@@ -194,6 +202,7 @@ public class ApiClient {
/**
* Helper method to set access token for the first OAuth2 authentication.
* @param accessToken Access token
*/
public void setAccessToken(String accessToken) {
for (Authentication auth : authentications.values()) {
@@ -207,6 +216,8 @@ public class ApiClient {
/**
* Set the User-Agent header's value (by adding to the default header map).
* @param userAgent Http user agent
* @return API client
*/
public ApiClient setUserAgent(String userAgent) {
addDefaultHeader("User-Agent", userAgent);
@@ -218,6 +229,7 @@ public class ApiClient {
*
* @param key The header's key
* @param value The header's value
* @return API client
*/
public ApiClient addDefaultHeader(String key, String value) {
defaultHeaderMap.put(key, value);
@@ -226,6 +238,7 @@ public class ApiClient {
/**
* Check that whether debugging is enabled for this API client.
* @return True if debugging is switched on
*/
public boolean isDebugging() {
return debugging;
@@ -235,6 +248,7 @@ public class ApiClient {
* Enable/disable debugging for this API client.
*
* @param debugging To enable (true) or disable (false) debugging
* @return API client
*/
public ApiClient setDebugging(boolean debugging) {
this.debugging = debugging;
@@ -248,12 +262,17 @@ public class ApiClient {
* with file response. The default value is <code>null</code>, i.e. using
* the system's default tempopary folder.
*
* @see https://docs.oracle.com/javase/7/docs/api/java/io/File.html#createTempFile(java.lang.String,%20java.lang.String,%20java.io.File)
* @return Temp folder path
*/
public String getTempFolderPath() {
return tempFolderPath;
}
/**
* Set temp folder path
* @param tempFolderPath Temp folder path
* @return API client
*/
public ApiClient setTempFolderPath(String tempFolderPath) {
this.tempFolderPath = tempFolderPath;
return this;
@@ -261,6 +280,7 @@ public class ApiClient {
/**
* Connect timeout (in milliseconds).
* @return Connection timeout
*/
public int getConnectTimeout() {
return connectionTimeout;
@@ -270,6 +290,8 @@ public class ApiClient {
* Set the connect timeout (in milliseconds).
* A value of 0 means no timeout, otherwise values must be between 1 and
* {@link Integer#MAX_VALUE}.
* @param connectionTimeout Connection timeout in milliseconds
* @return API client
*/
public ApiClient setConnectTimeout(int connectionTimeout) {
this.connectionTimeout = connectionTimeout;
@@ -279,6 +301,7 @@ public class ApiClient {
/**
* Get the date format used to parse/format date parameters.
* @return Date format
*/
public DateFormat getDateFormat() {
return dateFormat;
@@ -286,6 +309,8 @@ public class ApiClient {
/**
* Set the date format used to parse/format date parameters.
* @param dateFormat Date format
* @return API client
*/
public ApiClient setDateFormat(DateFormat dateFormat) {
this.dateFormat = dateFormat;
@@ -296,6 +321,8 @@ public class ApiClient {
/**
* Parse the given string into Date object.
* @param str String
* @return Date
*/
public Date parseDate(String str) {
try {
@@ -307,6 +334,8 @@ public class ApiClient {
/**
* Format the given Date object into string.
* @param date Date
* @return Date in string format
*/
public String formatDate(Date date) {
return dateFormat.format(date);
@@ -314,6 +343,8 @@ public class ApiClient {
/**
* Format the given parameter object into string.
* @param param Object
* @return Object in string format
*/
public String parameterToString(Object param) {
if (param == null) {
@@ -335,8 +366,12 @@ public class ApiClient {
}
/*
Format to {@code Pair} objects.
*/
* Format to {@code Pair} objects.
* @param collectionFormat Collection format
* @param name Name
* @param value Value
* @return List of pairs
*/
public List<Pair> parameterToPairs(String collectionFormat, String name, Object value){
List<Pair> params = new ArrayList<Pair>();
@@ -355,8 +390,8 @@ public class ApiClient {
return params;
}
// get the collection format
String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // default: csv
// get the collection format (default: csv)
String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat);
// create the params based on the collection format
if ("multi".equals(format)) {
@@ -396,6 +431,8 @@ public class ApiClient {
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* @param mime MIME
* @return True if the MIME type is JSON
*/
public boolean isJsonMime(String mime) {
return mime != null && mime.matches("(?i)application\\/json(;.*)?");
@@ -445,6 +482,8 @@ public class ApiClient {
/**
* Escape the given string to be used as URL query value.
* @param str String
* @return Escaped string
*/
public String escapeString(String str) {
try {
@@ -457,6 +496,11 @@ public class ApiClient {
/**
* Serialize the given Java object into string entity according the given
* Content-Type (only JSON is supported for now).
* @param obj Object
* @param formParams Form parameters
* @param contentType Context type
* @return Entity
* @throws ApiException API exception
*/
public Entity<?> serialize(Object obj, Map<String, Object> formParams, String contentType) throws ApiException {
Entity<?> entity;
@@ -489,6 +533,11 @@ public class ApiClient {
/**
* Deserialize response body to Java object according to the Content-Type.
* @param <T> Type
* @param response Response
* @param returnType Return type
* @return Deserialize object
* @throws ApiException API exception
*/
@SuppressWarnings("unchecked")
public <T> T deserialize(Response response, GenericType<T> returnType) throws ApiException {
@@ -517,6 +566,8 @@ public class ApiClient {
/**
* Download file from the given response.
* @param response Response
* @return File
* @throws ApiException If fail to read file content from response and write to disk
*/
public File downloadFileFromResponse(Response response) throws ApiException {
@@ -567,6 +618,7 @@ public class ApiClient {
/**
* Invoke API by sending HTTP request with the given options.
*
* @param <T> Type
* @param path The sub-path of the HTTP URL
* @param method The request method, one of "GET", "POST", "PUT", and "DELETE"
* @param queryParams The query parameters
@@ -578,6 +630,7 @@ public class ApiClient {
* @param authNames The authentications to apply
* @param returnType The return type into which to deserialize the response
* @return The response body in type of string
* @throws ApiException API exception
*/
public <T> T invokeAPI(String path, String method, List<Pair> queryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String accept, String contentType, String[] authNames, GenericType<T> returnType) throws ApiException {
updateParamsForAuth(authNames, queryParams, headerParams);
@@ -662,6 +715,8 @@ public class ApiClient {
/**
* Build the Client used to make HTTP requests.
* @param debugging Debug setting
* @return Client
*/
private Client buildHttpClient(boolean debugging) {
final ClientConfig clientConfig = new ClientConfig();

View File

@@ -25,6 +25,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
/**
* Set the date format for JSON (de)serialization with Date properties.
* @param dateFormat Date format
*/
public void setDateFormat(DateFormat dateFormat) {
mapper.setDateFormat(dateFormat);

View File

@@ -1,78 +0,0 @@
package io.swagger.client.api;
import io.swagger.client.ApiException;
import io.swagger.client.ApiClient;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import javax.ws.rs.core.GenericType;
import io.swagger.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Fake_classname_tags123Api {
private ApiClient apiClient;
public Fake_classname_tags123Api() {
this(Configuration.getDefaultApiClient());
}
public Fake_classname_tags123Api(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* To test class name in snake case
*
* @param body client model (required)
* @return Client
* @throws ApiException if fails to make API call
*/
public Client testClassname(Client body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling testClassname");
}
// create path and map variables
String localVarPath = "/fake_classname_test".replaceAll("\\{format\\}","json");
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType<Client> localVarReturnType = new GenericType<Client>() {};
return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
}

View File

@@ -124,7 +124,7 @@ public class PetApi {
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter (required)
* @return List<Pet>
* @return List&lt;Pet&gt;
* @throws ApiException if fails to make API call
*/
public List<Pet> findPetsByStatus(List<String> status) throws ApiException {
@@ -166,7 +166,7 @@ public class PetApi {
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by (required)
* @return List<Pet>
* @return List&lt;Pet&gt;
* @throws ApiException if fails to make API call
*/
public List<Pet> findPetsByTags(List<String> tags) throws ApiException {

View File

@@ -78,7 +78,7 @@ public class StoreApi {
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return Map<String, Integer>
* @return Map&lt;String, Integer&gt;
* @throws ApiException if fails to make API call
*/
public Map<String, Integer> getInventory() throws ApiException {

View File

@@ -24,10 +24,12 @@ import io.swagger.annotations.ApiModelProperty;
/**
* Animal
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className" )
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
})
public class Animal {
@JsonProperty("className")
private String className = null;

View File

@@ -0,0 +1,204 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Capitalization
*/
public class Capitalization {
@JsonProperty("smallCamel")
private String smallCamel = null;
@JsonProperty("CapitalCamel")
private String capitalCamel = null;
@JsonProperty("small_Snake")
private String smallSnake = null;
@JsonProperty("Capital_Snake")
private String capitalSnake = null;
@JsonProperty("SCA_ETH_Flow_Points")
private String scAETHFlowPoints = null;
@JsonProperty("ATT_NAME")
private String ATT_NAME = null;
public Capitalization smallCamel(String smallCamel) {
this.smallCamel = smallCamel;
return this;
}
/**
* Get smallCamel
* @return smallCamel
**/
@ApiModelProperty(example = "null", value = "")
public String getSmallCamel() {
return smallCamel;
}
public void setSmallCamel(String smallCamel) {
this.smallCamel = smallCamel;
}
public Capitalization capitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
return this;
}
/**
* Get capitalCamel
* @return capitalCamel
**/
@ApiModelProperty(example = "null", value = "")
public String getCapitalCamel() {
return capitalCamel;
}
public void setCapitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
}
public Capitalization smallSnake(String smallSnake) {
this.smallSnake = smallSnake;
return this;
}
/**
* Get smallSnake
* @return smallSnake
**/
@ApiModelProperty(example = "null", value = "")
public String getSmallSnake() {
return smallSnake;
}
public void setSmallSnake(String smallSnake) {
this.smallSnake = smallSnake;
}
public Capitalization capitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
return this;
}
/**
* Get capitalSnake
* @return capitalSnake
**/
@ApiModelProperty(example = "null", value = "")
public String getCapitalSnake() {
return capitalSnake;
}
public void setCapitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
}
public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
return this;
}
/**
* Get scAETHFlowPoints
* @return scAETHFlowPoints
**/
@ApiModelProperty(example = "null", value = "")
public String getScAETHFlowPoints() {
return scAETHFlowPoints;
}
public void setScAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
}
public Capitalization ATT_NAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
return this;
}
/**
* Name of the pet
* @return ATT_NAME
**/
@ApiModelProperty(example = "null", value = "Name of the pet ")
public String getATTNAME() {
return ATT_NAME;
}
public void setATTNAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Capitalization capitalization = (Capitalization) o;
return Objects.equals(this.smallCamel, capitalization.smallCamel) &&
Objects.equals(this.capitalCamel, capitalization.capitalCamel) &&
Objects.equals(this.smallSnake, capitalization.smallSnake) &&
Objects.equals(this.capitalSnake, capitalization.capitalSnake) &&
Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) &&
Objects.equals(this.ATT_NAME, capitalization.ATT_NAME);
}
@Override
public int hashCode() {
return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Capitalization {\n");
sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n");
sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n");
sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n");
sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n");
sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n");
sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -31,7 +31,9 @@ public class EnumTest {
public enum EnumStringEnum {
UPPER("UPPER"),
LOWER("lower");
LOWER("lower"),
EMPTY("");
private String value;

View File

@@ -0,0 +1,15 @@
# Capitalization
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**smallCamel** | **String** | | [optional]
**capitalCamel** | **String** | | [optional]
**smallSnake** | **String** | | [optional]
**capitalSnake** | **String** | | [optional]
**scAETHFlowPoints** | **String** | | [optional]
**ATT_NAME** | **String** | Name of the pet | [optional]

View File

@@ -16,6 +16,7 @@ Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;
EMPTY | &quot;&quot;
<a name="EnumIntegerEnum"></a>

View File

@@ -6,8 +6,10 @@
<packaging>jar</packaging>
<name>swagger-petstore-jersey2</name>
<version>1.0.0</version>
<url>https://github.com/swagger-api/swagger-codegen</url>
<description>Swagger Java</description>
<scm>
<connection>scm:git:git@github.com:swagger-api/swagger-mustache.git</connection>
<connection>scm:git:git@github.com:swagger-api/swagger-codegen.git</connection>
<developerConnection>scm:git:git@github.com:swagger-api/swagger-codegen.git</developerConnection>
<url>https://github.com/swagger-api/swagger-codegen</url>
</scm>
@@ -22,7 +24,16 @@
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>Swagger</name>
<email>apiteam@swagger.io</email>
<organization>Swagger</organization>
<organizationUrl>http://swagger.io</organizationUrl>
</developer>
</developers>
<build>
<plugins>
<plugin>
@@ -116,9 +127,55 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign-artifacts</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>

View File

@@ -86,6 +86,7 @@ public class ApiClient {
/**
* Gets the JSON instance to do JSON serialization and deserialization.
* @return JSON
*/
public JSON getJSON() {
return json;
@@ -111,6 +112,7 @@ public class ApiClient {
/**
* Gets the status code of the previous request
* @return Status code
*/
public int getStatusCode() {
return statusCode;
@@ -118,6 +120,7 @@ public class ApiClient {
/**
* Gets the response headers of the previous request
* @return Response headers
*/
public Map<String, List<String>> getResponseHeaders() {
return responseHeaders;
@@ -125,6 +128,7 @@ public class ApiClient {
/**
* Get authentications (key: authentication name, value: authentication).
* @return Map of authentication object
*/
public Map<String, Authentication> getAuthentications() {
return authentications;
@@ -142,6 +146,7 @@ public class ApiClient {
/**
* Helper method to set username for the first HTTP basic authentication.
* @param username Username
*/
public void setUsername(String username) {
for (Authentication auth : authentications.values()) {
@@ -155,6 +160,7 @@ public class ApiClient {
/**
* Helper method to set password for the first HTTP basic authentication.
* @param password Password
*/
public void setPassword(String password) {
for (Authentication auth : authentications.values()) {
@@ -168,6 +174,7 @@ public class ApiClient {
/**
* Helper method to set API key value for the first API key authentication.
* @param apiKey API key
*/
public void setApiKey(String apiKey) {
for (Authentication auth : authentications.values()) {
@@ -181,6 +188,7 @@ public class ApiClient {
/**
* Helper method to set API key prefix for the first API key authentication.
* @param apiKeyPrefix API key prefix
*/
public void setApiKeyPrefix(String apiKeyPrefix) {
for (Authentication auth : authentications.values()) {
@@ -194,6 +202,7 @@ public class ApiClient {
/**
* Helper method to set access token for the first OAuth2 authentication.
* @param accessToken Access token
*/
public void setAccessToken(String accessToken) {
for (Authentication auth : authentications.values()) {
@@ -207,6 +216,8 @@ public class ApiClient {
/**
* Set the User-Agent header's value (by adding to the default header map).
* @param userAgent Http user agent
* @return API client
*/
public ApiClient setUserAgent(String userAgent) {
addDefaultHeader("User-Agent", userAgent);
@@ -218,6 +229,7 @@ public class ApiClient {
*
* @param key The header's key
* @param value The header's value
* @return API client
*/
public ApiClient addDefaultHeader(String key, String value) {
defaultHeaderMap.put(key, value);
@@ -226,6 +238,7 @@ public class ApiClient {
/**
* Check that whether debugging is enabled for this API client.
* @return True if debugging is switched on
*/
public boolean isDebugging() {
return debugging;
@@ -235,6 +248,7 @@ public class ApiClient {
* Enable/disable debugging for this API client.
*
* @param debugging To enable (true) or disable (false) debugging
* @return API client
*/
public ApiClient setDebugging(boolean debugging) {
this.debugging = debugging;
@@ -248,12 +262,17 @@ public class ApiClient {
* with file response. The default value is <code>null</code>, i.e. using
* the system's default tempopary folder.
*
* @see https://docs.oracle.com/javase/7/docs/api/java/io/File.html#createTempFile(java.lang.String,%20java.lang.String,%20java.io.File)
* @return Temp folder path
*/
public String getTempFolderPath() {
return tempFolderPath;
}
/**
* Set temp folder path
* @param tempFolderPath Temp folder path
* @return API client
*/
public ApiClient setTempFolderPath(String tempFolderPath) {
this.tempFolderPath = tempFolderPath;
return this;
@@ -261,6 +280,7 @@ public class ApiClient {
/**
* Connect timeout (in milliseconds).
* @return Connection timeout
*/
public int getConnectTimeout() {
return connectionTimeout;
@@ -270,6 +290,8 @@ public class ApiClient {
* Set the connect timeout (in milliseconds).
* A value of 0 means no timeout, otherwise values must be between 1 and
* {@link Integer#MAX_VALUE}.
* @param connectionTimeout Connection timeout in milliseconds
* @return API client
*/
public ApiClient setConnectTimeout(int connectionTimeout) {
this.connectionTimeout = connectionTimeout;
@@ -279,6 +301,7 @@ public class ApiClient {
/**
* Get the date format used to parse/format date parameters.
* @return Date format
*/
public DateFormat getDateFormat() {
return dateFormat;
@@ -286,6 +309,8 @@ public class ApiClient {
/**
* Set the date format used to parse/format date parameters.
* @param dateFormat Date format
* @return API client
*/
public ApiClient setDateFormat(DateFormat dateFormat) {
this.dateFormat = dateFormat;
@@ -296,6 +321,8 @@ public class ApiClient {
/**
* Parse the given string into Date object.
* @param str String
* @return Date
*/
public Date parseDate(String str) {
try {
@@ -307,6 +334,8 @@ public class ApiClient {
/**
* Format the given Date object into string.
* @param date Date
* @return Date in string format
*/
public String formatDate(Date date) {
return dateFormat.format(date);
@@ -314,6 +343,8 @@ public class ApiClient {
/**
* Format the given parameter object into string.
* @param param Object
* @return Object in string format
*/
public String parameterToString(Object param) {
if (param == null) {
@@ -335,8 +366,12 @@ public class ApiClient {
}
/*
Format to {@code Pair} objects.
*/
* Format to {@code Pair} objects.
* @param collectionFormat Collection format
* @param name Name
* @param value Value
* @return List of pairs
*/
public List<Pair> parameterToPairs(String collectionFormat, String name, Object value){
List<Pair> params = new ArrayList<Pair>();
@@ -355,8 +390,8 @@ public class ApiClient {
return params;
}
// get the collection format
String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // default: csv
// get the collection format (default: csv)
String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat);
// create the params based on the collection format
if ("multi".equals(format)) {
@@ -396,6 +431,8 @@ public class ApiClient {
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* @param mime MIME
* @return True if the MIME type is JSON
*/
public boolean isJsonMime(String mime) {
return mime != null && mime.matches("(?i)application\\/json(;.*)?");
@@ -445,6 +482,8 @@ public class ApiClient {
/**
* Escape the given string to be used as URL query value.
* @param str String
* @return Escaped string
*/
public String escapeString(String str) {
try {
@@ -457,6 +496,11 @@ public class ApiClient {
/**
* Serialize the given Java object into string entity according the given
* Content-Type (only JSON is supported for now).
* @param obj Object
* @param formParams Form parameters
* @param contentType Context type
* @return Entity
* @throws ApiException API exception
*/
public Entity<?> serialize(Object obj, Map<String, Object> formParams, String contentType) throws ApiException {
Entity<?> entity;
@@ -489,6 +533,11 @@ public class ApiClient {
/**
* Deserialize response body to Java object according to the Content-Type.
* @param <T> Type
* @param response Response
* @param returnType Return type
* @return Deserialize object
* @throws ApiException API exception
*/
@SuppressWarnings("unchecked")
public <T> T deserialize(Response response, GenericType<T> returnType) throws ApiException {
@@ -517,6 +566,8 @@ public class ApiClient {
/**
* Download file from the given response.
* @param response Response
* @return File
* @throws ApiException If fail to read file content from response and write to disk
*/
public File downloadFileFromResponse(Response response) throws ApiException {
@@ -567,6 +618,7 @@ public class ApiClient {
/**
* Invoke API by sending HTTP request with the given options.
*
* @param <T> Type
* @param path The sub-path of the HTTP URL
* @param method The request method, one of "GET", "POST", "PUT", and "DELETE"
* @param queryParams The query parameters
@@ -578,6 +630,7 @@ public class ApiClient {
* @param authNames The authentications to apply
* @param returnType The return type into which to deserialize the response
* @return The response body in type of string
* @throws ApiException API exception
*/
public <T> T invokeAPI(String path, String method, List<Pair> queryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String accept, String contentType, String[] authNames, GenericType<T> returnType) throws ApiException {
updateParamsForAuth(authNames, queryParams, headerParams);
@@ -662,6 +715,8 @@ public class ApiClient {
/**
* Build the Client used to make HTTP requests.
* @param debugging Debug setting
* @return Client
*/
private Client buildHttpClient(boolean debugging) {
final ClientConfig clientConfig = new ClientConfig();

View File

@@ -30,6 +30,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
/**
* Set the date format for JSON (de)serialization with Date properties.
* @param dateFormat Date format
*/
public void setDateFormat(DateFormat dateFormat) {
mapper.setDateFormat(dateFormat);

View File

@@ -1,78 +0,0 @@
package io.swagger.client.api;
import io.swagger.client.ApiException;
import io.swagger.client.ApiClient;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import javax.ws.rs.core.GenericType;
import io.swagger.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Fake_classname_tags123Api {
private ApiClient apiClient;
public Fake_classname_tags123Api() {
this(Configuration.getDefaultApiClient());
}
public Fake_classname_tags123Api(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* To test class name in snake case
*
* @param body client model (required)
* @return Client
* @throws ApiException if fails to make API call
*/
public Client testClassname(Client body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling testClassname");
}
// create path and map variables
String localVarPath = "/fake_classname_test".replaceAll("\\{format\\}","json");
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType<Client> localVarReturnType = new GenericType<Client>() {};
return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
}

View File

@@ -124,7 +124,7 @@ public class PetApi {
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter (required)
* @return List<Pet>
* @return List&lt;Pet&gt;
* @throws ApiException if fails to make API call
*/
public List<Pet> findPetsByStatus(List<String> status) throws ApiException {
@@ -166,7 +166,7 @@ public class PetApi {
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by (required)
* @return List<Pet>
* @return List&lt;Pet&gt;
* @throws ApiException if fails to make API call
*/
public List<Pet> findPetsByTags(List<String> tags) throws ApiException {

View File

@@ -78,7 +78,7 @@ public class StoreApi {
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return Map<String, Integer>
* @return Map&lt;String, Integer&gt;
* @throws ApiException if fails to make API call
*/
public Map<String, Integer> getInventory() throws ApiException {

View File

@@ -24,10 +24,12 @@ import io.swagger.annotations.ApiModelProperty;
/**
* Animal
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className" )
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
})
public class Animal {
@JsonProperty("className")
private String className = null;

View File

@@ -0,0 +1,204 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Capitalization
*/
public class Capitalization {
@JsonProperty("smallCamel")
private String smallCamel = null;
@JsonProperty("CapitalCamel")
private String capitalCamel = null;
@JsonProperty("small_Snake")
private String smallSnake = null;
@JsonProperty("Capital_Snake")
private String capitalSnake = null;
@JsonProperty("SCA_ETH_Flow_Points")
private String scAETHFlowPoints = null;
@JsonProperty("ATT_NAME")
private String ATT_NAME = null;
public Capitalization smallCamel(String smallCamel) {
this.smallCamel = smallCamel;
return this;
}
/**
* Get smallCamel
* @return smallCamel
**/
@ApiModelProperty(example = "null", value = "")
public String getSmallCamel() {
return smallCamel;
}
public void setSmallCamel(String smallCamel) {
this.smallCamel = smallCamel;
}
public Capitalization capitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
return this;
}
/**
* Get capitalCamel
* @return capitalCamel
**/
@ApiModelProperty(example = "null", value = "")
public String getCapitalCamel() {
return capitalCamel;
}
public void setCapitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
}
public Capitalization smallSnake(String smallSnake) {
this.smallSnake = smallSnake;
return this;
}
/**
* Get smallSnake
* @return smallSnake
**/
@ApiModelProperty(example = "null", value = "")
public String getSmallSnake() {
return smallSnake;
}
public void setSmallSnake(String smallSnake) {
this.smallSnake = smallSnake;
}
public Capitalization capitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
return this;
}
/**
* Get capitalSnake
* @return capitalSnake
**/
@ApiModelProperty(example = "null", value = "")
public String getCapitalSnake() {
return capitalSnake;
}
public void setCapitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
}
public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
return this;
}
/**
* Get scAETHFlowPoints
* @return scAETHFlowPoints
**/
@ApiModelProperty(example = "null", value = "")
public String getScAETHFlowPoints() {
return scAETHFlowPoints;
}
public void setScAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
}
public Capitalization ATT_NAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
return this;
}
/**
* Name of the pet
* @return ATT_NAME
**/
@ApiModelProperty(example = "null", value = "Name of the pet ")
public String getATTNAME() {
return ATT_NAME;
}
public void setATTNAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Capitalization capitalization = (Capitalization) o;
return Objects.equals(this.smallCamel, capitalization.smallCamel) &&
Objects.equals(this.capitalCamel, capitalization.capitalCamel) &&
Objects.equals(this.smallSnake, capitalization.smallSnake) &&
Objects.equals(this.capitalSnake, capitalization.capitalSnake) &&
Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) &&
Objects.equals(this.ATT_NAME, capitalization.ATT_NAME);
}
@Override
public int hashCode() {
return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Capitalization {\n");
sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n");
sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n");
sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n");
sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n");
sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n");
sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -31,7 +31,9 @@ public class EnumTest {
public enum EnumStringEnum {
UPPER("UPPER"),
LOWER("lower");
LOWER("lower"),
EMPTY("");
private String value;

View File

@@ -16,6 +16,7 @@ Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;
EMPTY | &quot;&quot;
<a name="EnumIntegerEnum"></a>

View File

@@ -6,8 +6,10 @@
<packaging>jar</packaging>
<name>swagger-petstore-okhttp-gson</name>
<version>1.0.0</version>
<url>https://github.com/swagger-api/swagger-codegen</url>
<description>Swagger Java</description>
<scm>
<connection>scm:git:git@github.com:swagger-api/swagger-mustache.git</connection>
<connection>scm:git:git@github.com:swagger-api/swagger-codegen.git</connection>
<developerConnection>scm:git:git@github.com:swagger-api/swagger-codegen.git</developerConnection>
<url>https://github.com/swagger-api/swagger-codegen</url>
</scm>
@@ -22,7 +24,16 @@
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>Swagger</name>
<email>apiteam@swagger.io</email>
<organization>Swagger</organization>
<organizationUrl>http://swagger.io</organizationUrl>
</developer>
</developers>
<build>
<plugins>
<plugin>
@@ -108,9 +119,55 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign-artifacts</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>

View File

@@ -24,6 +24,7 @@ import android.os.Parcel;
* Animal
*/
public class Animal implements Parcelable {
@SerializedName("className")
private String className = null;

View File

@@ -34,7 +34,10 @@ public class EnumTest implements Parcelable {
UPPER("UPPER"),
@SerializedName("lower")
LOWER("lower");
LOWER("lower"),
@SerializedName("")
EMPTY("");
private String value;

View File

@@ -0,0 +1,15 @@
# Capitalization
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**smallCamel** | **String** | | [optional]
**capitalCamel** | **String** | | [optional]
**smallSnake** | **String** | | [optional]
**capitalSnake** | **String** | | [optional]
**scAETHFlowPoints** | **String** | | [optional]
**ATT_NAME** | **String** | Name of the pet | [optional]

View File

@@ -16,6 +16,7 @@ Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;
EMPTY | &quot;&quot;
<a name="EnumIntegerEnum"></a>

View File

@@ -6,8 +6,10 @@
<packaging>jar</packaging>
<name>swagger-petstore-okhttp-gson</name>
<version>1.0.0</version>
<url>https://github.com/swagger-api/swagger-codegen</url>
<description>Swagger Java</description>
<scm>
<connection>scm:git:git@github.com:swagger-api/swagger-mustache.git</connection>
<connection>scm:git:git@github.com:swagger-api/swagger-codegen.git</connection>
<developerConnection>scm:git:git@github.com:swagger-api/swagger-codegen.git</developerConnection>
<url>https://github.com/swagger-api/swagger-codegen</url>
</scm>
@@ -22,7 +24,16 @@
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>Swagger</name>
<email>apiteam@swagger.io</email>
<organization>Swagger</organization>
<organizationUrl>http://swagger.io</organizationUrl>
</developer>
</developers>
<build>
<plugins>
<plugin>
@@ -108,9 +119,55 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign-artifacts</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>

View File

@@ -1,175 +0,0 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.api;
import io.swagger.client.ApiCallback;
import io.swagger.client.ApiClient;
import io.swagger.client.ApiException;
import io.swagger.client.ApiResponse;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import io.swagger.client.ProgressRequestBody;
import io.swagger.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import io.swagger.client.model.Client;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Fake_classname_tags123Api {
private ApiClient apiClient;
public Fake_classname_tags123Api() {
this(Configuration.getDefaultApiClient());
}
public Fake_classname_tags123Api(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/* Build call for testClassname */
private com.squareup.okhttp.Call testClassnameCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/fake_classname_test".replaceAll("\\{format\\}","json");
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call testClassnameValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling testClassname(Async)");
}
com.squareup.okhttp.Call call = testClassnameCall(body, progressListener, progressRequestListener);
return call;
}
/**
* To test class name in snake case
*
* @param body client model (required)
* @return Client
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public Client testClassname(Client body) throws ApiException {
ApiResponse<Client> resp = testClassnameWithHttpInfo(body);
return resp.getData();
}
/**
* To test class name in snake case
*
* @param body client model (required)
* @return ApiResponse&lt;Client&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Client> testClassnameWithHttpInfo(Client body) throws ApiException {
com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(body, null, null);
Type localVarReturnType = new TypeToken<Client>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* To test class name in snake case (asynchronously)
*
* @param body client model (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call testClassnameAsync(Client body, final ApiCallback<Client> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(body, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Client>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
}

View File

@@ -22,6 +22,7 @@ import io.swagger.annotations.ApiModelProperty;
* Animal
*/
public class Animal {
@SerializedName("className")
private String className = null;

View File

@@ -0,0 +1,203 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Capitalization
*/
public class Capitalization {
@SerializedName("smallCamel")
private String smallCamel = null;
@SerializedName("CapitalCamel")
private String capitalCamel = null;
@SerializedName("small_Snake")
private String smallSnake = null;
@SerializedName("Capital_Snake")
private String capitalSnake = null;
@SerializedName("SCA_ETH_Flow_Points")
private String scAETHFlowPoints = null;
@SerializedName("ATT_NAME")
private String ATT_NAME = null;
public Capitalization smallCamel(String smallCamel) {
this.smallCamel = smallCamel;
return this;
}
/**
* Get smallCamel
* @return smallCamel
**/
@ApiModelProperty(example = "null", value = "")
public String getSmallCamel() {
return smallCamel;
}
public void setSmallCamel(String smallCamel) {
this.smallCamel = smallCamel;
}
public Capitalization capitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
return this;
}
/**
* Get capitalCamel
* @return capitalCamel
**/
@ApiModelProperty(example = "null", value = "")
public String getCapitalCamel() {
return capitalCamel;
}
public void setCapitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
}
public Capitalization smallSnake(String smallSnake) {
this.smallSnake = smallSnake;
return this;
}
/**
* Get smallSnake
* @return smallSnake
**/
@ApiModelProperty(example = "null", value = "")
public String getSmallSnake() {
return smallSnake;
}
public void setSmallSnake(String smallSnake) {
this.smallSnake = smallSnake;
}
public Capitalization capitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
return this;
}
/**
* Get capitalSnake
* @return capitalSnake
**/
@ApiModelProperty(example = "null", value = "")
public String getCapitalSnake() {
return capitalSnake;
}
public void setCapitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
}
public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
return this;
}
/**
* Get scAETHFlowPoints
* @return scAETHFlowPoints
**/
@ApiModelProperty(example = "null", value = "")
public String getScAETHFlowPoints() {
return scAETHFlowPoints;
}
public void setScAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
}
public Capitalization ATT_NAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
return this;
}
/**
* Name of the pet
* @return ATT_NAME
**/
@ApiModelProperty(example = "null", value = "Name of the pet ")
public String getATTNAME() {
return ATT_NAME;
}
public void setATTNAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Capitalization capitalization = (Capitalization) o;
return Objects.equals(this.smallCamel, capitalization.smallCamel) &&
Objects.equals(this.capitalCamel, capitalization.capitalCamel) &&
Objects.equals(this.smallSnake, capitalization.smallSnake) &&
Objects.equals(this.capitalSnake, capitalization.capitalSnake) &&
Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) &&
Objects.equals(this.ATT_NAME, capitalization.ATT_NAME);
}
@Override
public int hashCode() {
return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Capitalization {\n");
sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n");
sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n");
sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n");
sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n");
sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n");
sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -32,7 +32,10 @@ public class EnumTest {
UPPER("UPPER"),
@SerializedName("lower")
LOWER("lower");
LOWER("lower"),
@SerializedName("")
EMPTY("");
private String value;

View File

@@ -6,8 +6,10 @@
<packaging>jar</packaging>
<name>swagger-petstore-retrofit</name>
<version>1.0.0</version>
<url>https://github.com/swagger-api/swagger-codegen</url>
<description>Swagger Java</description>
<scm>
<connection>scm:git:git@github.com:swagger-api/swagger-mustache.git</connection>
<connection>scm:git:git@github.com:swagger-api/swagger-codegen.git</connection>
<developerConnection>scm:git:git@github.com:swagger-api/swagger-codegen.git</developerConnection>
<url>https://github.com/swagger-api/swagger-codegen</url>
</scm>
@@ -22,7 +24,16 @@
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>Swagger</name>
<email>apiteam@swagger.io</email>
<organization>Swagger</organization>
<organizationUrl>http://swagger.io</organizationUrl>
</developer>
</developers>
<build>
<plugins>
<plugin>
@@ -116,9 +127,55 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign-artifacts</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>

View File

@@ -54,11 +54,11 @@ public class ApiClient {
this();
for(String authName : authNames) {
Interceptor auth;
if (authName == "api_key") {
if ("api_key".equals(authName)) {
auth = new ApiKeyAuth("header", "api_key");
} else if (authName == "http_basic_test") {
} else if ("http_basic_test".equals(authName)) {
auth = new HttpBasicAuth();
} else if (authName == "petstore_auth") {
} else if ("petstore_auth".equals(authName)) {
auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
} else {
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
@@ -69,7 +69,7 @@ public class ApiClient {
/**
* Basic constructor for single auth name
* @param authName
* @param authName Authentication name
*/
public ApiClient(String authName) {
this(new String[]{authName});
@@ -77,8 +77,8 @@ public class ApiClient {
/**
* Helper constructor for single api key
* @param authName
* @param apiKey
* @param authName Authentication name
* @param apiKey API key
*/
public ApiClient(String authName, String apiKey) {
this(authName);
@@ -87,9 +87,9 @@ public class ApiClient {
/**
* Helper constructor for single basic auth or password oauth2
* @param authName
* @param username
* @param password
* @param authName Authentication name
* @param username Username
* @param password Password
*/
public ApiClient(String authName, String username, String password) {
this(authName);
@@ -98,11 +98,11 @@ public class ApiClient {
/**
* Helper constructor for single password oauth2
* @param authName
* @param clientId
* @param secret
* @param username
* @param password
* @param authName Authentication name
* @param clientId Client ID
* @param secret Client secret
* @param username Username
* @param password Password
*/
public ApiClient(String authName, String clientId, String secret, String username, String password) {
this(authName);
@@ -136,7 +136,7 @@ public class ApiClient {
/**
* Helper method to configure the first api key found
* @param apiKey
* @param apiKey API key
*/
private void setApiKey(String apiKey) {
for(Interceptor apiAuthorization : apiAuthorizations.values()) {
@@ -150,8 +150,8 @@ public class ApiClient {
/**
* Helper method to configure the username/password for basic auth or password oauth
* @param username
* @param password
* @param username Username
* @param password Password
*/
private void setCredentials(String username, String password) {
for(Interceptor apiAuthorization : apiAuthorizations.values()) {
@@ -170,7 +170,7 @@ public class ApiClient {
/**
* Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one)
* @return
* @return Token request builder
*/
public TokenRequestBuilder getTokenEndPoint() {
for(Interceptor apiAuthorization : apiAuthorizations.values()) {
@@ -184,7 +184,7 @@ public class ApiClient {
/**
* Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one)
* @return
* @return Authentication request builder
*/
public AuthenticationRequestBuilder getAuthorizationEndPoint() {
for(Interceptor apiAuthorization : apiAuthorizations.values()) {
@@ -198,7 +198,7 @@ public class ApiClient {
/**
* Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one)
* @param accessToken
* @param accessToken Access token
*/
public void setAccessToken(String accessToken) {
for(Interceptor apiAuthorization : apiAuthorizations.values()) {
@@ -212,9 +212,9 @@ public class ApiClient {
/**
* Helper method to configure the oauth accessCode/implicit flow parameters
* @param clientId
* @param clientSecret
* @param redirectURI
* @param clientId Client ID
* @param clientSecret Client secret
* @param redirectURI Redirect URI
*/
public void configureAuthorizationFlow(String clientId, String clientSecret, String redirectURI) {
for(Interceptor apiAuthorization : apiAuthorizations.values()) {
@@ -234,7 +234,7 @@ public class ApiClient {
/**
* Configures a listener which is notified when a new access token is received.
* @param accessTokenListener
* @param accessTokenListener Access token listener
*/
public void registerAccessTokenListener(AccessTokenListener accessTokenListener) {
for(Interceptor apiAuthorization : apiAuthorizations.values()) {
@@ -248,8 +248,8 @@ public class ApiClient {
/**
* Adds an authorization to be used by the client
* @param authName
* @param authorization
* @param authName Authentication name
* @param authorization Authorization
*/
public void addAuthorization(String authName, Interceptor authorization) {
if (apiAuthorizations.containsKey(authName)) {
@@ -287,7 +287,7 @@ public class ApiClient {
/**
* Clones the okClient given in parameter, adds the auth interceptors and uses it to configure the RestAdapter
* @param okClient
* @param okClient OkHttp client
*/
public void configureFromOkclient(OkHttpClient okClient) {
OkHttpClient clone = okClient.clone();
@@ -355,14 +355,15 @@ class GsonConverterWrapper implements Converter {
*/
class DateTimeTypeAdapter extends TypeAdapter<DateTime> {
private final DateTimeFormatter formatter = ISODateTimeFormat.dateTime();
private final DateTimeFormatter parseFormatter = ISODateTimeFormat.dateOptionalTimeParser();
private final DateTimeFormatter printFormatter = ISODateTimeFormat.dateTime();
@Override
public void write(JsonWriter out, DateTime date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.print(date));
out.value(printFormatter.print(date));
}
}
@@ -374,7 +375,7 @@ class DateTimeTypeAdapter extends TypeAdapter<DateTime> {
return null;
default:
String date = in.nextString();
return formatter.parseDateTime(date);
return parseFormatter.parseDateTime(date);
}
}
}

View File

@@ -35,7 +35,6 @@ public interface FakeApi {
* Async method
* @param body client model (required)
* @param cb callback method
* @return void
*/
@PATCH("/fake")
@@ -87,7 +86,6 @@ public interface FakeApi {
* @param password None (optional)
* @param paramCallback None (optional)
* @param cb callback method
* @return void
*/
@retrofit.http.FormUrlEncoded
@@ -128,7 +126,6 @@ public interface FakeApi {
* @param enumQueryInteger Query parameter enum test (double) (optional)
* @param enumQueryDouble Query parameter enum test (double) (optional)
* @param cb callback method
* @return void
*/
@retrofit.http.FormUrlEncoded

View File

@@ -1,42 +0,0 @@
package io.swagger.client.api;
import io.swagger.client.CollectionFormats.*;
import retrofit.Callback;
import retrofit.http.*;
import retrofit.mime.*;
import io.swagger.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface Fake_classname_tags123Api {
/**
* To test class name in snake case
* Sync method
*
* @param body client model (required)
* @return Client
*/
@PATCH("/fake_classname_test")
Client testClassname(
@retrofit.http.Body Client body
);
/**
* To test class name in snake case
* Async method
* @param body client model (required)
* @param cb callback method
* @return void
*/
@PATCH("/fake_classname_test")
void testClassname(
@retrofit.http.Body Client body, Callback<Client> cb
);
}

View File

@@ -34,7 +34,6 @@ public interface PetApi {
* Async method
* @param body Pet object that needs to be added to the store (required)
* @param cb callback method
* @return void
*/
@POST("/pet")
@@ -61,7 +60,6 @@ public interface PetApi {
* @param petId Pet id to delete (required)
* @param apiKey (optional)
* @param cb callback method
* @return void
*/
@DELETE("/pet/{petId}")
@@ -73,7 +71,7 @@ public interface PetApi {
* Sync method
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter (required)
* @return List<Pet>
* @return List&lt;Pet&gt;
*/
@GET("/pet/findByStatus")
@@ -86,7 +84,6 @@ public interface PetApi {
* Async method
* @param status Status values that need to be considered for filter (required)
* @param cb callback method
* @return void
*/
@GET("/pet/findByStatus")
@@ -98,7 +95,7 @@ public interface PetApi {
* Sync method
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by (required)
* @return List<Pet>
* @return List&lt;Pet&gt;
*/
@GET("/pet/findByTags")
@@ -111,7 +108,6 @@ public interface PetApi {
* Async method
* @param tags Tags to filter by (required)
* @param cb callback method
* @return void
*/
@GET("/pet/findByTags")
@@ -136,7 +132,6 @@ public interface PetApi {
* Async method
* @param petId ID of pet to return (required)
* @param cb callback method
* @return void
*/
@GET("/pet/{petId}")
@@ -161,7 +156,6 @@ public interface PetApi {
* Async method
* @param body Pet object that needs to be added to the store (required)
* @param cb callback method
* @return void
*/
@PUT("/pet")
@@ -191,7 +185,6 @@ public interface PetApi {
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @param cb callback method
* @return void
*/
@retrofit.http.FormUrlEncoded
@@ -222,7 +215,6 @@ public interface PetApi {
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @param cb callback method
* @return void
*/
@retrofit.http.Multipart

View File

@@ -32,7 +32,6 @@ public interface StoreApi {
* Async method
* @param orderId ID of the order that needs to be deleted (required)
* @param cb callback method
* @return void
*/
@DELETE("/store/order/{orderId}")
@@ -43,7 +42,7 @@ public interface StoreApi {
* Returns pet inventories by status
* Sync method
* Returns a map of status codes to quantities
* @return Map<String, Integer>
* @return Map&lt;String, Integer&gt;
*/
@GET("/store/inventory")
@@ -54,7 +53,6 @@ public interface StoreApi {
* Returns pet inventories by status
* Async method
* @param cb callback method
* @return void
*/
@GET("/store/inventory")
@@ -79,7 +77,6 @@ public interface StoreApi {
* Async method
* @param orderId ID of pet that needs to be fetched (required)
* @param cb callback method
* @return void
*/
@GET("/store/order/{orderId}")
@@ -104,7 +101,6 @@ public interface StoreApi {
* Async method
* @param body order placed for purchasing the pet (required)
* @param cb callback method
* @return void
*/
@POST("/store/order")

View File

@@ -32,7 +32,6 @@ public interface UserApi {
* Async method
* @param body Created user object (required)
* @param cb callback method
* @return void
*/
@POST("/user")
@@ -57,7 +56,6 @@ public interface UserApi {
* Async method
* @param body List of user object (required)
* @param cb callback method
* @return void
*/
@POST("/user/createWithArray")
@@ -82,7 +80,6 @@ public interface UserApi {
* Async method
* @param body List of user object (required)
* @param cb callback method
* @return void
*/
@POST("/user/createWithList")
@@ -107,7 +104,6 @@ public interface UserApi {
* Async method
* @param username The name that needs to be deleted (required)
* @param cb callback method
* @return void
*/
@DELETE("/user/{username}")
@@ -132,7 +128,6 @@ public interface UserApi {
* Async method
* @param username The name that needs to be fetched. Use user1 for testing. (required)
* @param cb callback method
* @return void
*/
@GET("/user/{username}")
@@ -159,7 +154,6 @@ public interface UserApi {
* @param username The user name for login (required)
* @param password The password for login in clear text (required)
* @param cb callback method
* @return void
*/
@GET("/user/login")
@@ -181,7 +175,6 @@ public interface UserApi {
* Logs out current logged in user session
* Async method
* @param cb callback method
* @return void
*/
@GET("/user/logout")
@@ -208,7 +201,6 @@ public interface UserApi {
* @param username name that need to be deleted (required)
* @param body Updated user object (required)
* @param cb callback method
* @return void
*/
@PUT("/user/{username}")

View File

@@ -22,6 +22,7 @@ import io.swagger.annotations.ApiModelProperty;
* Animal
*/
public class Animal {
@SerializedName("className")
private String className = null;

View File

@@ -0,0 +1,203 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Capitalization
*/
public class Capitalization {
@SerializedName("smallCamel")
private String smallCamel = null;
@SerializedName("CapitalCamel")
private String capitalCamel = null;
@SerializedName("small_Snake")
private String smallSnake = null;
@SerializedName("Capital_Snake")
private String capitalSnake = null;
@SerializedName("SCA_ETH_Flow_Points")
private String scAETHFlowPoints = null;
@SerializedName("ATT_NAME")
private String ATT_NAME = null;
public Capitalization smallCamel(String smallCamel) {
this.smallCamel = smallCamel;
return this;
}
/**
* Get smallCamel
* @return smallCamel
**/
@ApiModelProperty(example = "null", value = "")
public String getSmallCamel() {
return smallCamel;
}
public void setSmallCamel(String smallCamel) {
this.smallCamel = smallCamel;
}
public Capitalization capitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
return this;
}
/**
* Get capitalCamel
* @return capitalCamel
**/
@ApiModelProperty(example = "null", value = "")
public String getCapitalCamel() {
return capitalCamel;
}
public void setCapitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
}
public Capitalization smallSnake(String smallSnake) {
this.smallSnake = smallSnake;
return this;
}
/**
* Get smallSnake
* @return smallSnake
**/
@ApiModelProperty(example = "null", value = "")
public String getSmallSnake() {
return smallSnake;
}
public void setSmallSnake(String smallSnake) {
this.smallSnake = smallSnake;
}
public Capitalization capitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
return this;
}
/**
* Get capitalSnake
* @return capitalSnake
**/
@ApiModelProperty(example = "null", value = "")
public String getCapitalSnake() {
return capitalSnake;
}
public void setCapitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
}
public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
return this;
}
/**
* Get scAETHFlowPoints
* @return scAETHFlowPoints
**/
@ApiModelProperty(example = "null", value = "")
public String getScAETHFlowPoints() {
return scAETHFlowPoints;
}
public void setScAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
}
public Capitalization ATT_NAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
return this;
}
/**
* Name of the pet
* @return ATT_NAME
**/
@ApiModelProperty(example = "null", value = "Name of the pet ")
public String getATTNAME() {
return ATT_NAME;
}
public void setATTNAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Capitalization capitalization = (Capitalization) o;
return Objects.equals(this.smallCamel, capitalization.smallCamel) &&
Objects.equals(this.capitalCamel, capitalization.capitalCamel) &&
Objects.equals(this.smallSnake, capitalization.smallSnake) &&
Objects.equals(this.capitalSnake, capitalization.capitalSnake) &&
Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) &&
Objects.equals(this.ATT_NAME, capitalization.ATT_NAME);
}
@Override
public int hashCode() {
return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Capitalization {\n");
sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n");
sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n");
sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n");
sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n");
sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n");
sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -32,7 +32,10 @@ public class EnumTest {
UPPER("UPPER"),
@SerializedName("lower")
LOWER("lower");
LOWER("lower"),
@SerializedName("")
EMPTY("");
private String value;

View File

@@ -0,0 +1,15 @@
# Capitalization
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**smallCamel** | **String** | | [optional]
**capitalCamel** | **String** | | [optional]
**smallSnake** | **String** | | [optional]
**capitalSnake** | **String** | | [optional]
**scAETHFlowPoints** | **String** | | [optional]
**ATT_NAME** | **String** | Name of the pet | [optional]

View File

@@ -16,6 +16,7 @@ Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;
EMPTY | &quot;&quot;
<a name="EnumIntegerEnum"></a>

View File

@@ -6,8 +6,10 @@
<packaging>jar</packaging>
<name>swagger-java-client</name>
<version>1.0.0</version>
<url>https://github.com/swagger-api/swagger-codegen</url>
<description>Swagger Java</description>
<scm>
<connection>scm:git:git@github.com:swagger-api/swagger-mustache.git</connection>
<connection>scm:git:git@github.com:swagger-api/swagger-codegen.git</connection>
<developerConnection>scm:git:git@github.com:swagger-api/swagger-codegen.git</developerConnection>
<url>https://github.com/swagger-api/swagger-codegen</url>
</scm>
@@ -22,7 +24,16 @@
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>Swagger</name>
<email>apiteam@swagger.io</email>
<organization>Swagger</organization>
<organizationUrl>http://swagger.io</organizationUrl>
</developer>
</developers>
<build>
<plugins>
<plugin>
@@ -108,9 +119,55 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign-artifacts</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>
@@ -142,7 +199,7 @@
<artifactId>threetenbp</artifactId>
<version>${threetenbp-version}</version>
</dependency>
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.squareup.retrofit2</groupId>
@@ -163,7 +220,7 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-version}</version>
</dependency>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>

View File

@@ -53,7 +53,7 @@ public interface PetApi {
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter (required)
* @return Call&lt;List<Pet>&gt;
* @return Call&lt;List&lt;Pet&gt;&gt;
*/
@GET("pet/findByStatus")
@@ -65,7 +65,7 @@ public interface PetApi {
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by (required)
* @return Call&lt;List<Pet>&gt;
* @return Call&lt;List&lt;Pet&gt;&gt;
*/
@GET("pet/findByTags")

View File

@@ -34,7 +34,7 @@ public interface StoreApi {
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return Call&lt;Map<String, Integer>&gt;
* @return Call&lt;Map&lt;String, Integer&gt;&gt;
*/
@GET("store/inventory")

View File

@@ -25,10 +25,12 @@ import javax.validation.constraints.*;
/**
* Animal
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className" )
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
})
public class Animal {
@JsonProperty("className")
private String className = null;

View File

@@ -0,0 +1,205 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;
/**
* Capitalization
*/
public class Capitalization {
@JsonProperty("smallCamel")
private String smallCamel = null;
@JsonProperty("CapitalCamel")
private String capitalCamel = null;
@JsonProperty("small_Snake")
private String smallSnake = null;
@JsonProperty("Capital_Snake")
private String capitalSnake = null;
@JsonProperty("SCA_ETH_Flow_Points")
private String scAETHFlowPoints = null;
@JsonProperty("ATT_NAME")
private String ATT_NAME = null;
public Capitalization smallCamel(String smallCamel) {
this.smallCamel = smallCamel;
return this;
}
/**
* Get smallCamel
* @return smallCamel
**/
@ApiModelProperty(example = "null", value = "")
public String getSmallCamel() {
return smallCamel;
}
public void setSmallCamel(String smallCamel) {
this.smallCamel = smallCamel;
}
public Capitalization capitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
return this;
}
/**
* Get capitalCamel
* @return capitalCamel
**/
@ApiModelProperty(example = "null", value = "")
public String getCapitalCamel() {
return capitalCamel;
}
public void setCapitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
}
public Capitalization smallSnake(String smallSnake) {
this.smallSnake = smallSnake;
return this;
}
/**
* Get smallSnake
* @return smallSnake
**/
@ApiModelProperty(example = "null", value = "")
public String getSmallSnake() {
return smallSnake;
}
public void setSmallSnake(String smallSnake) {
this.smallSnake = smallSnake;
}
public Capitalization capitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
return this;
}
/**
* Get capitalSnake
* @return capitalSnake
**/
@ApiModelProperty(example = "null", value = "")
public String getCapitalSnake() {
return capitalSnake;
}
public void setCapitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
}
public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
return this;
}
/**
* Get scAETHFlowPoints
* @return scAETHFlowPoints
**/
@ApiModelProperty(example = "null", value = "")
public String getScAETHFlowPoints() {
return scAETHFlowPoints;
}
public void setScAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
}
public Capitalization ATT_NAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
return this;
}
/**
* Name of the pet
* @return ATT_NAME
**/
@ApiModelProperty(example = "null", value = "Name of the pet ")
public String getATTNAME() {
return ATT_NAME;
}
public void setATTNAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Capitalization capitalization = (Capitalization) o;
return Objects.equals(this.smallCamel, capitalization.smallCamel) &&
Objects.equals(this.capitalCamel, capitalization.capitalCamel) &&
Objects.equals(this.smallSnake, capitalization.smallSnake) &&
Objects.equals(this.capitalSnake, capitalization.capitalSnake) &&
Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) &&
Objects.equals(this.ATT_NAME, capitalization.ATT_NAME);
}
@Override
public int hashCode() {
return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Capitalization {\n");
sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n");
sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n");
sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n");
sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n");
sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n");
sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -32,7 +32,9 @@ public class EnumTest {
public enum EnumStringEnum {
UPPER("UPPER"),
LOWER("lower");
LOWER("lower"),
EMPTY("");
private String value;

View File

@@ -142,6 +142,8 @@ public class FormatTest {
* @return number
**/
@NotNull
@DecimalMin("32.1")
@DecimalMax("543.2")
@ApiModelProperty(example = "null", required = true, value = "")
public BigDecimal getNumber() {
return number;
@@ -162,6 +164,8 @@ public class FormatTest {
* maximum: 987.6
* @return _float
**/
@DecimalMin("54.3")
@DecimalMax("987.6")
@ApiModelProperty(example = "null", value = "")
public Float getFloat() {
return _float;
@@ -182,6 +186,8 @@ public class FormatTest {
* maximum: 123.4
* @return _double
**/
@DecimalMin("67.8")
@DecimalMax("123.4")
@ApiModelProperty(example = "null", value = "")
public Double getDouble() {
return _double;

View File

@@ -0,0 +1,15 @@
# Capitalization
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**smallCamel** | **String** | | [optional]
**capitalCamel** | **String** | | [optional]
**smallSnake** | **String** | | [optional]
**capitalSnake** | **String** | | [optional]
**scAETHFlowPoints** | **String** | | [optional]
**ATT_NAME** | **String** | Name of the pet | [optional]

View File

@@ -16,6 +16,7 @@ Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;
EMPTY | &quot;&quot;
<a name="EnumIntegerEnum"></a>

View File

@@ -6,8 +6,10 @@
<packaging>jar</packaging>
<name>swagger-petstore-retrofit2</name>
<version>1.0.0</version>
<url>https://github.com/swagger-api/swagger-codegen</url>
<description>Swagger Java</description>
<scm>
<connection>scm:git:git@github.com:swagger-api/swagger-mustache.git</connection>
<connection>scm:git:git@github.com:swagger-api/swagger-codegen.git</connection>
<developerConnection>scm:git:git@github.com:swagger-api/swagger-codegen.git</developerConnection>
<url>https://github.com/swagger-api/swagger-codegen</url>
</scm>
@@ -22,7 +24,16 @@
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>Swagger</name>
<email>apiteam@swagger.io</email>
<organization>Swagger</organization>
<organizationUrl>http://swagger.io</organizationUrl>
</developer>
</developers>
<build>
<plugins>
<plugin>
@@ -108,9 +119,55 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign-artifacts</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>
@@ -142,7 +199,7 @@
<artifactId>threetenbp</artifactId>
<version>${threetenbp-version}</version>
</dependency>
<!-- test dependencies -->
<dependency>

View File

@@ -42,11 +42,11 @@ public class ApiClient {
this();
for(String authName : authNames) {
Interceptor auth;
if (authName.equals("api_key")) {
if ("api_key".equals(authName)) {
auth = new ApiKeyAuth("header", "api_key");
} else if (authName.equals("http_basic_test")) {
} else if ("http_basic_test".equals(authName)) {
auth = new HttpBasicAuth();
} else if (authName.equals("petstore_auth")) {
} else if ("petstore_auth".equals(authName)) {
auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
} else {
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
@@ -374,3 +374,61 @@ class GsonCustomConverterFactory extends Converter.Factory
}
}
/**
* Gson TypeAdapter for Joda DateTime type
*/
class DateTimeTypeAdapter extends TypeAdapter<DateTime> {
private final DateTimeFormatter parseFormatter = ISODateTimeFormat.dateOptionalTimeParser();
private final DateTimeFormatter printFormatter = ISODateTimeFormat.dateTime();
@Override
public void write(JsonWriter out, DateTime date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(printFormatter.print(date));
}
}
@Override
public DateTime read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
return parseFormatter.parseDateTime(date);
}
}
}
/**
* Gson TypeAdapter for Joda LocalDate type
*/
class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
private final DateTimeFormatter formatter = ISODateTimeFormat.date();
@Override
public void write(JsonWriter out, LocalDate date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.print(date));
}
}
@Override
public LocalDate read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
return formatter.parseLocalDate(date);
}
}
}

View File

@@ -1,35 +0,0 @@
package io.swagger.client.api;
import io.swagger.client.CollectionFormats.*;
import retrofit2.Call;
import retrofit2.http.*;
import okhttp3.RequestBody;
import io.swagger.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface Fake_classname_tags123Api {
/**
* To test class name in snake case
*
* @param body client model (required)
* @return Call&lt;Client&gt;
*/
@Headers({
"Content-Type:application/json"
})
@PATCH("fake_classname_test")
Call<Client> testClassname(
@retrofit2.http.Body Client body
);
}

View File

@@ -51,7 +51,7 @@ public interface PetApi {
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter (required)
* @return Call&lt;List<Pet>&gt;
* @return Call&lt;List&lt;Pet&gt;&gt;
*/
@GET("pet/findByStatus")
@@ -63,7 +63,7 @@ public interface PetApi {
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by (required)
* @return Call&lt;List<Pet>&gt;
* @return Call&lt;List&lt;Pet&gt;&gt;
*/
@GET("pet/findByTags")

View File

@@ -32,7 +32,7 @@ public interface StoreApi {
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return Call&lt;Map<String, Integer>&gt;
* @return Call&lt;Map&lt;String, Integer&gt;&gt;
*/
@GET("store/inventory")

View File

@@ -22,6 +22,7 @@ import io.swagger.annotations.ApiModelProperty;
* Animal
*/
public class Animal {
@SerializedName("className")
private String className = null;

View File

@@ -0,0 +1,203 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Capitalization
*/
public class Capitalization {
@SerializedName("smallCamel")
private String smallCamel = null;
@SerializedName("CapitalCamel")
private String capitalCamel = null;
@SerializedName("small_Snake")
private String smallSnake = null;
@SerializedName("Capital_Snake")
private String capitalSnake = null;
@SerializedName("SCA_ETH_Flow_Points")
private String scAETHFlowPoints = null;
@SerializedName("ATT_NAME")
private String ATT_NAME = null;
public Capitalization smallCamel(String smallCamel) {
this.smallCamel = smallCamel;
return this;
}
/**
* Get smallCamel
* @return smallCamel
**/
@ApiModelProperty(example = "null", value = "")
public String getSmallCamel() {
return smallCamel;
}
public void setSmallCamel(String smallCamel) {
this.smallCamel = smallCamel;
}
public Capitalization capitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
return this;
}
/**
* Get capitalCamel
* @return capitalCamel
**/
@ApiModelProperty(example = "null", value = "")
public String getCapitalCamel() {
return capitalCamel;
}
public void setCapitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
}
public Capitalization smallSnake(String smallSnake) {
this.smallSnake = smallSnake;
return this;
}
/**
* Get smallSnake
* @return smallSnake
**/
@ApiModelProperty(example = "null", value = "")
public String getSmallSnake() {
return smallSnake;
}
public void setSmallSnake(String smallSnake) {
this.smallSnake = smallSnake;
}
public Capitalization capitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
return this;
}
/**
* Get capitalSnake
* @return capitalSnake
**/
@ApiModelProperty(example = "null", value = "")
public String getCapitalSnake() {
return capitalSnake;
}
public void setCapitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
}
public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
return this;
}
/**
* Get scAETHFlowPoints
* @return scAETHFlowPoints
**/
@ApiModelProperty(example = "null", value = "")
public String getScAETHFlowPoints() {
return scAETHFlowPoints;
}
public void setScAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
}
public Capitalization ATT_NAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
return this;
}
/**
* Name of the pet
* @return ATT_NAME
**/
@ApiModelProperty(example = "null", value = "Name of the pet ")
public String getATTNAME() {
return ATT_NAME;
}
public void setATTNAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Capitalization capitalization = (Capitalization) o;
return Objects.equals(this.smallCamel, capitalization.smallCamel) &&
Objects.equals(this.capitalCamel, capitalization.capitalCamel) &&
Objects.equals(this.smallSnake, capitalization.smallSnake) &&
Objects.equals(this.capitalSnake, capitalization.capitalSnake) &&
Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) &&
Objects.equals(this.ATT_NAME, capitalization.ATT_NAME);
}
@Override
public int hashCode() {
return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Capitalization {\n");
sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n");
sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n");
sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n");
sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n");
sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n");
sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -32,7 +32,10 @@ public class EnumTest {
UPPER("UPPER"),
@SerializedName("lower")
LOWER("lower");
LOWER("lower"),
@SerializedName("")
EMPTY("");
private String value;

View File

@@ -0,0 +1,15 @@
# Capitalization
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**smallCamel** | **String** | | [optional]
**capitalCamel** | **String** | | [optional]
**smallSnake** | **String** | | [optional]
**capitalSnake** | **String** | | [optional]
**scAETHFlowPoints** | **String** | | [optional]
**ATT_NAME** | **String** | Name of the pet | [optional]

View File

@@ -16,6 +16,7 @@ Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;
EMPTY | &quot;&quot;
<a name="EnumIntegerEnum"></a>

View File

@@ -6,8 +6,10 @@
<packaging>jar</packaging>
<name>swagger-petstore-retrofit2-rx</name>
<version>1.0.0</version>
<url>https://github.com/swagger-api/swagger-codegen</url>
<description>Swagger Java</description>
<scm>
<connection>scm:git:git@github.com:swagger-api/swagger-mustache.git</connection>
<connection>scm:git:git@github.com:swagger-api/swagger-codegen.git</connection>
<developerConnection>scm:git:git@github.com:swagger-api/swagger-codegen.git</developerConnection>
<url>https://github.com/swagger-api/swagger-codegen</url>
</scm>
@@ -22,7 +24,16 @@
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>Swagger</name>
<email>apiteam@swagger.io</email>
<organization>Swagger</organization>
<organizationUrl>http://swagger.io</organizationUrl>
</developer>
</developers>
<build>
<plugins>
<plugin>
@@ -108,9 +119,55 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign-artifacts</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>
@@ -152,7 +209,7 @@
<artifactId>adapter-rxjava</artifactId>
<version>${retrofit-version}</version>
</dependency>
<!-- test dependencies -->
<dependency>

View File

@@ -43,11 +43,11 @@ public class ApiClient {
this();
for(String authName : authNames) {
Interceptor auth;
if (authName.equals("api_key")) {
if ("api_key".equals(authName)) {
auth = new ApiKeyAuth("header", "api_key");
} else if (authName.equals("http_basic_test")) {
} else if ("http_basic_test".equals(authName)) {
auth = new HttpBasicAuth();
} else if (authName.equals("petstore_auth")) {
} else if ("petstore_auth".equals(authName)) {
auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
} else {
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
@@ -376,3 +376,61 @@ class GsonCustomConverterFactory extends Converter.Factory
}
}
/**
* Gson TypeAdapter for Joda DateTime type
*/
class DateTimeTypeAdapter extends TypeAdapter<DateTime> {
private final DateTimeFormatter parseFormatter = ISODateTimeFormat.dateOptionalTimeParser();
private final DateTimeFormatter printFormatter = ISODateTimeFormat.dateTime();
@Override
public void write(JsonWriter out, DateTime date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(printFormatter.print(date));
}
}
@Override
public DateTime read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
return parseFormatter.parseDateTime(date);
}
}
}
/**
* Gson TypeAdapter for Joda LocalDate type
*/
class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
private final DateTimeFormatter formatter = ISODateTimeFormat.date();
@Override
public void write(JsonWriter out, LocalDate date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.print(date));
}
}
@Override
public LocalDate read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
return formatter.parseLocalDate(date);
}
}
}

View File

@@ -1,35 +0,0 @@
package io.swagger.client.api;
import io.swagger.client.CollectionFormats.*;
import rx.Observable;
import retrofit2.http.*;
import okhttp3.RequestBody;
import io.swagger.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface Fake_classname_tags123Api {
/**
* To test class name in snake case
*
* @param body client model (required)
* @return Call&lt;Client&gt;
*/
@Headers({
"Content-Type:application/json"
})
@PATCH("fake_classname_test")
Observable<Client> testClassname(
@retrofit2.http.Body Client body
);
}

View File

@@ -51,7 +51,7 @@ public interface PetApi {
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter (required)
* @return Call&lt;List<Pet>&gt;
* @return Call&lt;List&lt;Pet&gt;&gt;
*/
@GET("pet/findByStatus")
@@ -63,7 +63,7 @@ public interface PetApi {
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by (required)
* @return Call&lt;List<Pet>&gt;
* @return Call&lt;List&lt;Pet&gt;&gt;
*/
@GET("pet/findByTags")

View File

@@ -32,7 +32,7 @@ public interface StoreApi {
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return Call&lt;Map<String, Integer>&gt;
* @return Call&lt;Map&lt;String, Integer&gt;&gt;
*/
@GET("store/inventory")

Some files were not shown because too many files have changed in this diff Show More