[java] Improve pom.xml to qualify for publishing to Maven central (#4616)

* [java] Attach Javadoc to artifact generation.

* [java] Attach source to artifact generation.

* [java] Add gpg signing to artifact publishing.

* [java] Add artifact URL to pom.xml .

* [java] Add artifact description to pom.xml .

* [java] Add artifact URL and description params to Jax RSS.

* [java] Add developer info to pom.xml .

* [java] Parameterise SCM info in generated pom.xml .

* [java] Move GPG signing to verify phase so that .asc files are uploaded during deploy phase.

* [java] Change GPG signing to be an optional via Maven profile. Can't assume all users will perform a release/deploy from an environment with correct GPG key/pass.

* update java petstore smaples

* camelize tag name, remove invalid file

* add back missing files for okhttp-gson

* fix docstring in java feign client

* fix docstring with various java api clients
This commit is contained in:
wing328
2017-01-22 11:40:59 +08:00
committed by GitHub
parent 4d19fb6b2f
commit 5306b11b4a
163 changed files with 9152 additions and 4190 deletions

View File

@@ -36,6 +36,33 @@ public class CodegenConstants {
public static final String ARTIFACT_VERSION = "artifactVersion";
public static final String ARTIFACT_VERSION_DESC = "artifact version in generated pom.xml";
public static final String ARTIFACT_URL = "artifactUrl";
public static final String ARTIFACT_URL_DESC = "artifact URL in generated pom.xml";
public static final String ARTIFACT_DESCRIPTION = "artifactDescription";
public static final String ARTIFACT_DESCRIPTION_DESC = "artifact description in generated pom.xml";
public static final String SCM_CONNECTION = "scmConnection";
public static final String SCM_CONNECTION_DESC = "SCM connection in generated pom.xml";
public static final String SCM_DEVELOPER_CONNECTION = "scmDeveloperConnection";
public static final String SCM_DEVELOPER_CONNECTION_DESC = "SCM developer connection in generated pom.xml";
public static final String SCM_URL = "scmUrl";
public static final String SCM_URL_DESC = "SCM URL in generated pom.xml";
public static final String DEVELOPER_NAME = "developerName";
public static final String DEVELOPER_NAME_DESC = "developer name in generated pom.xml";
public static final String DEVELOPER_EMAIL = "developerEmail";
public static final String DEVELOPER_EMAIL_DESC = "developer email in generated pom.xml";
public static final String DEVELOPER_ORGANIZATION = "developerOrganization";
public static final String DEVELOPER_ORGANIZATION_DESC = "developer organization in generated pom.xml";
public static final String DEVELOPER_ORGANIZATION_URL = "developerOrganizationUrl";
public static final String DEVELOPER_ORGANIZATION_URL_DESC = "developer organization URL in generated pom.xml";
public static final String LICENSE_NAME = "licenseName";
public static final String LICENSE_NAME_DESC = "The name of the license";

View File

@@ -52,6 +52,15 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
protected String groupId = "io.swagger";
protected String artifactId = "swagger-java";
protected String artifactVersion = "1.0.0";
protected String artifactUrl = "https://github.com/swagger-api/swagger-codegen";
protected String artifactDescription = "Swagger Java";
protected String developerName = "Swagger";
protected String developerEmail = "apiteam@swagger.io";
protected String developerOrganization = "Swagger";
protected String developerOrganizationUrl = "http://swagger.io";
protected String scmConnection = "scm:git:git@github.com:swagger-api/swagger-codegen.git";
protected String scmDeveloperConnection = "scm:git:git@github.com:swagger-api/swagger-codegen.git";
protected String scmUrl = "https://github.com/swagger-api/swagger-codegen";
protected String licenseName = "Unlicense";
protected String licenseUrl = "http://unlicense.org";
protected String projectFolder = "src" + File.separator + "main";
@@ -119,6 +128,15 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, CodegenConstants.ARTIFACT_ID_DESC));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_URL, CodegenConstants.ARTIFACT_URL_DESC));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_DESCRIPTION, CodegenConstants.ARTIFACT_DESCRIPTION_DESC));
cliOptions.add(new CliOption(CodegenConstants.SCM_CONNECTION, CodegenConstants.SCM_CONNECTION_DESC));
cliOptions.add(new CliOption(CodegenConstants.SCM_DEVELOPER_CONNECTION, CodegenConstants.SCM_DEVELOPER_CONNECTION_DESC));
cliOptions.add(new CliOption(CodegenConstants.SCM_URL, CodegenConstants.SCM_URL_DESC));
cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_NAME, CodegenConstants.DEVELOPER_NAME_DESC));
cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_EMAIL, CodegenConstants.DEVELOPER_EMAIL_DESC));
cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_ORGANIZATION, CodegenConstants.DEVELOPER_ORGANIZATION_DESC));
cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_ORGANIZATION_URL, CodegenConstants.DEVELOPER_ORGANIZATION_URL_DESC));
cliOptions.add(new CliOption(CodegenConstants.LICENSE_NAME, CodegenConstants.LICENSE_NAME_DESC));
cliOptions.add(new CliOption(CodegenConstants.LICENSE_URL, CodegenConstants.LICENSE_URL_DESC));
cliOptions.add(new CliOption(CodegenConstants.SOURCE_FOLDER, CodegenConstants.SOURCE_FOLDER_DESC));
@@ -191,6 +209,60 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion);
}
if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_URL)) {
this.setArtifactUrl((String) additionalProperties.get(CodegenConstants.ARTIFACT_URL));
} else {
additionalProperties.put(CodegenConstants.ARTIFACT_URL, artifactUrl);
}
if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_DESCRIPTION)) {
this.setArtifactDescription((String) additionalProperties.get(CodegenConstants.ARTIFACT_DESCRIPTION));
} else {
additionalProperties.put(CodegenConstants.ARTIFACT_DESCRIPTION, artifactDescription);
}
if (additionalProperties.containsKey(CodegenConstants.SCM_CONNECTION)) {
this.setScmConnection((String) additionalProperties.get(CodegenConstants.SCM_CONNECTION));
} else {
additionalProperties.put(CodegenConstants.SCM_CONNECTION, scmConnection);
}
if (additionalProperties.containsKey(CodegenConstants.SCM_DEVELOPER_CONNECTION)) {
this.setScmDeveloperConnection((String) additionalProperties.get(CodegenConstants.SCM_DEVELOPER_CONNECTION));
} else {
additionalProperties.put(CodegenConstants.SCM_DEVELOPER_CONNECTION, scmDeveloperConnection);
}
if (additionalProperties.containsKey(CodegenConstants.SCM_URL)) {
this.setScmUrl((String) additionalProperties.get(CodegenConstants.SCM_URL));
} else {
additionalProperties.put(CodegenConstants.SCM_URL, scmUrl);
}
if (additionalProperties.containsKey(CodegenConstants.DEVELOPER_NAME)) {
this.setDeveloperName((String) additionalProperties.get(CodegenConstants.DEVELOPER_NAME));
} else {
additionalProperties.put(CodegenConstants.DEVELOPER_NAME, developerName);
}
if (additionalProperties.containsKey(CodegenConstants.DEVELOPER_EMAIL)) {
this.setDeveloperEmail((String) additionalProperties.get(CodegenConstants.DEVELOPER_EMAIL));
} else {
additionalProperties.put(CodegenConstants.DEVELOPER_EMAIL, developerEmail);
}
if (additionalProperties.containsKey(CodegenConstants.DEVELOPER_ORGANIZATION)) {
this.setDeveloperOrganization((String) additionalProperties.get(CodegenConstants.DEVELOPER_ORGANIZATION));
} else {
additionalProperties.put(CodegenConstants.DEVELOPER_ORGANIZATION, developerOrganization);
}
if (additionalProperties.containsKey(CodegenConstants.DEVELOPER_ORGANIZATION_URL)) {
this.setDeveloperOrganizationUrl((String) additionalProperties.get(CodegenConstants.DEVELOPER_ORGANIZATION_URL));
} else {
additionalProperties.put(CodegenConstants.DEVELOPER_ORGANIZATION_URL, developerOrganizationUrl);
}
if (additionalProperties.containsKey(CodegenConstants.LICENSE_NAME)) {
this.setLicenseName((String) additionalProperties.get(CodegenConstants.LICENSE_NAME));
} else {
@@ -929,6 +1001,42 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
this.artifactVersion = artifactVersion;
}
public void setArtifactUrl(String artifactUrl) {
this.artifactUrl = artifactUrl;
}
public void setArtifactDescription(String artifactDescription) {
this.artifactDescription = artifactDescription;
}
public void setScmConnection(String scmConnection) {
this.scmConnection = scmConnection;
}
public void setScmDeveloperConnection(String scmDeveloperConnection) {
this.scmDeveloperConnection = scmDeveloperConnection;
}
public void setScmUrl(String scmUrl) {
this.scmUrl = scmUrl;
}
public void setDeveloperName(String developerName) {
this.developerName = developerName;
}
public void setDeveloperEmail(String developerEmail) {
this.developerEmail = developerEmail;
}
public void setDeveloperOrganization(String developerOrganization) {
this.developerOrganization = developerOrganization;
}
public void setDeveloperOrganizationUrl(String developerOrganizationUrl) {
this.developerOrganizationUrl = developerOrganizationUrl;
}
public void setLicenseName(String licenseName) {
this.licenseName = licenseName;
}
@@ -1021,4 +1129,9 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
additionalProperties.put(propertyKey, value);
}
@Override
public String sanitizeTag(String tag) {
return camelize(sanitizeName(tag));
}
}

View File

@@ -102,6 +102,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
@@ -122,6 +123,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;
@@ -154,6 +156,7 @@ public class ApiClient {
/**
* Gets the status code of the previous request
* @return Status code
*/
public int getStatusCode() {
return statusCode;
@@ -161,6 +164,7 @@ public class ApiClient {
/**
* Gets the response headers of the previous request
* @return Response headers
*/
public Map<String, List<String>> getResponseHeaders() {
return responseHeaders;
@@ -168,6 +172,7 @@ public class ApiClient {
/**
* Get authentications (key: authentication name, value: authentication).
* @return Map of authentication
*/
public Map<String, Authentication> getAuthentications() {
return authentications;
@@ -185,6 +190,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()) {
@@ -198,6 +204,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()) {
@@ -211,6 +218,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()) {
@@ -224,6 +232,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()) {
@@ -237,6 +246,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()) {
@@ -250,6 +260,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);
@@ -261,6 +273,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);
@@ -269,6 +282,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;
@@ -278,6 +292,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;
@@ -288,6 +303,7 @@ public class ApiClient {
/**
* Connect timeout (in milliseconds).
* @return Connection timeout
*/
public int getConnectTimeout() {
return connectionTimeout;
@@ -297,6 +313,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;
@@ -306,6 +324,7 @@ public class ApiClient {
/**
* Get the date format used to parse/format date parameters.
* @return Date format
*/
public DateFormat getDateFormat() {
return dateFormat;
@@ -313,6 +332,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;
@@ -325,6 +346,8 @@ public class ApiClient {
/**
* Parse the given string into Date object.
* @param str String
* @return Date
*/
public Date parseDate(String str) {
try {
@@ -336,6 +359,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);
@@ -343,6 +368,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) {
@@ -364,7 +391,11 @@ 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>();
@@ -425,6 +456,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(;.*)?");
@@ -474,6 +507,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 {
@@ -486,6 +521,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")) {
@@ -591,6 +631,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
@@ -600,7 +641,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 {
@@ -639,6 +682,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) {
@@ -650,6 +695,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

@@ -44,9 +44,13 @@ public class {{classname}} {
{{#operation}}
/**
* {{summary}}
* {{notes}}{{#allParams}}
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}{{#returnType}}
* @return {{{returnType}}}{{/returnType}}
* {{notes}}
{{#allParams}}
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}}
{{#returnType}}
* @return {{returnType}}
{{/returnType}}
* @throws ApiException if fails to make API call
*/
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {

View File

@@ -159,6 +159,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);
@@ -196,7 +199,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()) {
@@ -211,8 +214,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()) {
@@ -232,7 +235,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()) {
@@ -246,7 +249,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()) {
@@ -260,8 +263,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()) {
@@ -275,9 +278,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()) {
@@ -297,7 +300,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()) {
@@ -309,14 +312,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

@@ -23,8 +23,12 @@ public interface {{classname}} extends ApiClient.Api {
/**
* {{summary}}
* {{notes}}
{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
{{#allParams}}
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}}
{{#returnType}}
* @return {{returnType}}
{{/returnType}}
*/
@RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{#hasMore}}&{{/hasMore}}{{/queryParams}}")
@Headers({

View File

@@ -6,10 +6,12 @@
<packaging>jar</packaging>
<name>{{artifactId}}</name>
<version>{{artifactVersion}}</version>
<url>{{artifactUrl}}</url>
<description>{{artifactDescription}}</description>
<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>
<connection>{{scmConnection}}</connection>
<developerConnection>{{scmDeveloperConnection}}</developerConnection>
<url>{{scmUrl}}</url>
</scm>
<prerequisites>
<maven>2.2.0</maven>
@@ -23,6 +25,15 @@
</license>
</licenses>
<developers>
<developer>
<name>{{developerName}}</name>
<email>{{developerEmail}}</email>
<organization>{{developerOrganization}}</organization>
<organizationUrl>{{developerOrganizationUrl}}</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

@@ -91,6 +91,7 @@ public class ApiClient {
/**
* Gets the JSON instance to do JSON serialization and deserialization.
* @return JSON
*/
public JSON getJSON() {
return json;
@@ -116,6 +117,7 @@ public class ApiClient {
/**
* Gets the status code of the previous request
* @return Status code
*/
public int getStatusCode() {
return statusCode;
@@ -123,6 +125,7 @@ public class ApiClient {
/**
* Gets the response headers of the previous request
* @return Response headers
*/
public Map<String, List<String>> getResponseHeaders() {
return responseHeaders;
@@ -130,6 +133,7 @@ public class ApiClient {
/**
* Get authentications (key: authentication name, value: authentication).
* @return Map of authentication object
*/
public Map<String, Authentication> getAuthentications() {
return authentications;
@@ -147,6 +151,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()) {
@@ -160,6 +165,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()) {
@@ -173,6 +179,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()) {
@@ -186,6 +193,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()) {
@@ -199,6 +207,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()) {
@@ -212,6 +221,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);
@@ -223,6 +234,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);
@@ -231,6 +243,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;
@@ -240,6 +253,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;
@@ -253,12 +267,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;
@@ -266,6 +285,7 @@ public class ApiClient {
/**
* Connect timeout (in milliseconds).
* @return Connection timeout
*/
public int getConnectTimeout() {
return connectionTimeout;
@@ -275,6 +295,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;
@@ -284,6 +306,7 @@ public class ApiClient {
/**
* Get the date format used to parse/format date parameters.
* @return Date format
*/
public DateFormat getDateFormat() {
return dateFormat;
@@ -291,6 +314,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;
@@ -301,6 +326,8 @@ public class ApiClient {
/**
* Parse the given string into Date object.
* @param str String
* @return Date
*/
public Date parseDate(String str) {
try {
@@ -312,6 +339,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);
@@ -319,6 +348,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) {
@@ -340,7 +371,11 @@ 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>();
@@ -360,8 +395,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)) {
@@ -401,6 +436,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(;.*)?");
@@ -450,6 +487,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 {
@@ -462,6 +501,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;
@@ -494,6 +538,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 {
@@ -522,6 +571,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 {
@@ -578,6 +629,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
@@ -589,6 +641,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);
@@ -673,6 +726,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

@@ -35,6 +35,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

@@ -41,9 +41,13 @@ public class {{classname}} {
{{#operation}}
/**
* {{summary}}
* {{notes}}{{#allParams}}
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}{{#returnType}}
* @return {{{returnType}}}{{/returnType}}
* {{notes}}
{{#allParams}}
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}}
{{#returnType}}
* @return {{returnType}}
{{/returnType}}
* @throws ApiException if fails to make API call
*/
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {

View File

@@ -6,10 +6,12 @@
<packaging>jar</packaging>
<name>{{artifactId}}</name>
<version>{{artifactVersion}}</version>
<url>{{artifactUrl}}</url>
<description>{{artifactDescription}}</description>
<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>
<connection>{{scmConnection}}</connection>
<developerConnection>{{scmDeveloperConnection}}</developerConnection>
<url>{{scmUrl}}</url>
</scm>
<prerequisites>
<maven>2.2.0</maven>
@@ -23,6 +25,15 @@
</license>
</licenses>
<developers>
<developer>
<name>{{developerName}}</name>
<email>{{developerEmail}}</email>
<organization>{{developerOrganization}}</organization>
<organizationUrl>{{developerOrganizationUrl}}</organizationUrl>
</developer>
</developers>
<build>
<plugins>
<plugin>
@@ -122,9 +133,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

@@ -6,10 +6,12 @@
<packaging>jar</packaging>
<name>{{artifactId}}</name>
<version>{{artifactVersion}}</version>
<url>{{artifactUrl}}</url>
<description>{{artifactDescription}}</description>
<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>
<connection>{{scmConnection}}</connection>
<developerConnection>{{scmDeveloperConnection}}</developerConnection>
<url>{{scmUrl}}</url>
</scm>
<prerequisites>
<maven>2.2.0</maven>
@@ -23,6 +25,15 @@
</license>
</licenses>
<developers>
<developer>
<name>{{developerName}}</name>
<email>{{developerEmail}}</email>
<organization>{{developerOrganization}}</organization>
<organizationUrl>{{developerOrganizationUrl}}</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

@@ -68,7 +68,7 @@ public class ApiClient {
/**
* Basic constructor for single auth name
* @param authName
* @param authName Authentication name
*/
public ApiClient(String authName) {
this(new String[]{authName});
@@ -76,8 +76,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);
@@ -86,9 +86,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);
@@ -97,11 +97,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);
@@ -135,7 +135,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()) {
@@ -149,8 +149,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()) {
@@ -169,7 +169,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()) {
@@ -183,7 +183,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()) {
@@ -197,7 +197,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()) {
@@ -211,9 +211,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()) {
@@ -233,7 +233,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()) {
@@ -247,8 +247,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)) {
@@ -286,7 +286,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();

View File

@@ -23,8 +23,12 @@ public interface {{classname}} {
* {{summary}}
* Sync method
* {{notes}}
{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
{{#allParams}}
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}}
{{#returnType}}
* @return {{returnType}}
{{/returnType}}
*/
{{#formParams}}{{#-first}}
{{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}}
@@ -36,9 +40,10 @@ public interface {{classname}} {
/**
* {{summary}}
* Async method
{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}} * @param cb callback method
* @return void
{{#allParams}}
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}}
* @param cb callback method
*/
{{#formParams}}{{#-first}}
{{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}}

View File

@@ -6,10 +6,12 @@
<packaging>jar</packaging>
<name>{{artifactId}}</name>
<version>{{artifactVersion}}</version>
<url>{{artifactUrl}}</url>
<description>{{artifactDescription}}</description>
<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>
<connection>{{scmConnection}}</connection>
<developerConnection>{{scmDeveloperConnection}}</developerConnection>
<url>{{scmUrl}}</url>
</scm>
<prerequisites>
<maven>2.2.0</maven>
@@ -23,6 +25,15 @@
</license>
</licenses>
<developers>
<developer>
<name>{{developerName}}</name>
<email>{{developerEmail}}</email>
<organization>{{developerOrganization}}</organization>
<organizationUrl>{{developerOrganizationUrl}}</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

@@ -29,8 +29,10 @@ public interface {{classname}} {
/**
* {{summary}}
* {{notes}}
{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}} * @return Call&lt;{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}&gt;
{{#allParams}}
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}}
* @return Call&lt;{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object{{/returnType}}&gt;
*/
{{#formParams}}{{#-first}}
{{#isMultipart}}@retrofit2.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit2.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}}

View File

@@ -6,10 +6,12 @@
<packaging>jar</packaging>
<name>{{artifactId}}</name>
<version>{{artifactVersion}}</version>
<url>{{artifactUrl}}</url>
<description>{{artifactDescription}}</description>
<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>
<connection>{{scmConnection}}</connection>
<developerConnection>{{scmDeveloperConnection}}</developerConnection>
<url>{{scmUrl}}</url>
</scm>
<prerequisites>
<maven>2.2.0</maven>
@@ -23,6 +25,15 @@
</license>
</licenses>
<developers>
<developer>
<name>{{developerName}}</name>
<email>{{developerEmail}}</email>
<organization>{{developerOrganization}}</organization>
<organizationUrl>{{developerOrganizationUrl}}</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

@@ -6,7 +6,13 @@
<packaging>jar</packaging>
<name>{{artifactId}}</name>
<version>{{artifactVersion}}</version>
<url>{{artifactUrl}}</url>
<description>{{artifactDescription}}</description>
<scm>
<connection>{{scmConnection}}</connection>
<developerConnection>{{scmDeveloperConnection}}</developerConnection>
<url>{{scmUrl}}</url>
</scm>
<prerequisites>
<maven>2.2.0</maven>
</prerequisites>
@@ -19,6 +25,15 @@
</license>
</licenses>
<developers>
<developer>
<name>{{developerName}}</name>
<email>{{developerEmail}}</email>
<organization>{{developerOrganization}}</organization>
<organizationUrl>{{developerOrganizationUrl}}</organizationUrl>
</developer>
</developers>
<build>
<plugins>
<plugin>
@@ -119,9 +134,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

@@ -46,6 +46,24 @@ public class JavaClientOptionsTest extends AbstractOptionsTest {
times = 1;
clientCodegen.setArtifactVersion(JavaClientOptionsProvider.ARTIFACT_VERSION_VALUE);
times = 1;
clientCodegen.setArtifactUrl(JavaClientOptionsProvider.ARTIFACT_URL_VALUE);
times = 1;
clientCodegen.setArtifactDescription(JavaClientOptionsProvider.ARTIFACT_DESCRIPTION_VALUE);
times = 1;
clientCodegen.setScmConnection(JavaClientOptionsProvider.SCM_CONNECTION_VALUE);
times = 1;
clientCodegen.setScmDeveloperConnection(JavaClientOptionsProvider.SCM_DEVELOPER_CONNECTION_VALUE);
times = 1;
clientCodegen.setScmUrl(JavaClientOptionsProvider.SCM_URL_VALUE);
times = 1;
clientCodegen.setDeveloperName(JavaClientOptionsProvider.DEVELOPER_NAME_VALUE);
times = 1;
clientCodegen.setDeveloperEmail(JavaClientOptionsProvider.DEVELOPER_EMAIL_VALUE);
times = 1;
clientCodegen.setDeveloperOrganization(JavaClientOptionsProvider.DEVELOPER_ORGANIZATION_VALUE);
times = 1;
clientCodegen.setDeveloperOrganizationUrl(JavaClientOptionsProvider.DEVELOPER_ORGANIZATION_URL_VALUE);
times = 1;
clientCodegen.setLicenseName(JavaClientOptionsProvider.LICENSE_NAME_VALUE);
times = 1;
clientCodegen.setLicenseUrl(JavaClientOptionsProvider.LICENSE_URL_VALUE);

View File

@@ -41,6 +41,24 @@ public class JaxRSServerOptionsTest extends AbstractOptionsTest {
times = 1;
clientCodegen.setArtifactVersion(JaxRSServerOptionsProvider.ARTIFACT_VERSION_VALUE);
times = 1;
clientCodegen.setArtifactUrl(JaxRSServerOptionsProvider.ARTIFACT_URL_VALUE);
times = 1;
clientCodegen.setArtifactDescription(JaxRSServerOptionsProvider.ARTIFACT_DESCRIPTION_VALUE);
times = 1;
clientCodegen.setScmConnection(JaxRSServerOptionsProvider.SCM_CONNECTION_VALUE);
times = 1;
clientCodegen.setScmDeveloperConnection(JaxRSServerOptionsProvider.SCM_DEVELOPER_CONNECTION_VALUE);
times = 1;
clientCodegen.setScmUrl(JaxRSServerOptionsProvider.SCM_URL_VALUE);
times = 1;
clientCodegen.setDeveloperName(JaxRSServerOptionsProvider.DEVELOPER_NAME_VALUE);
times = 1;
clientCodegen.setDeveloperEmail(JaxRSServerOptionsProvider.DEVELOPER_EMAIL_VALUE);
times = 1;
clientCodegen.setDeveloperOrganization(JaxRSServerOptionsProvider.DEVELOPER_ORGANIZATION_VALUE);
times = 1;
clientCodegen.setDeveloperOrganizationUrl(JaxRSServerOptionsProvider.DEVELOPER_ORGANIZATION_URL_VALUE);
times = 1;
clientCodegen.setSourceFolder(JaxRSServerOptionsProvider.SOURCE_FOLDER_VALUE);
times = 1;
clientCodegen.setLocalVariablePrefix(JaxRSServerOptionsProvider.LOCAL_PREFIX_VALUE);

View File

@@ -13,9 +13,18 @@ public class JavaOptionsProvider implements OptionsProvider {
public static final String INVOKER_PACKAGE_VALUE = "io.swagger.client.test";
public static final String LICENSE_NAME_VALUE = "Apache License, Version 2.0";
public static final String LICENSE_URL_VALUE = "http://www.apache.org/licenses/LICENSE-2.0";
public static final String DEVELOPER_NAME_VALUE = "Swagger";
public static final String DEVELOPER_EMAIL_VALUE = "apiteam@swagger.io";
public static final String DEVELOPER_ORGANIZATION_VALUE = "Swagger";
public static final String DEVELOPER_ORGANIZATION_URL_VALUE = "http://swagger.io";
public static final String SCM_CONNECTION_VALUE = "scm:git:git@github.com:swagger-api/swagger-codegen.git";
public static final String SCM_DEVELOPER_CONNECTION_VALUE = "scm:git:git@github.com:swagger-api/swagger-codegen.git";
public static final String SCM_URL_VALUE = "https://github.com/swagger-api/swagger-codegen";
public static final String SORT_PARAMS_VALUE = "false";
public static final String GROUP_ID_VALUE = "io.swagger.test";
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
public static final String ARTIFACT_URL_VALUE = "https://github.com/swagger-api/swagger-codegen";
public static final String ARTIFACT_DESCRIPTION_VALUE = "Swagger Java Client Test";
public static final String SOURCE_FOLDER_VALUE = "src/main/java/test";
public static final String LOCAL_PREFIX_VALUE = "tst";
public static final String SERIALIZABLE_MODEL_VALUE = "false";
@@ -41,6 +50,15 @@ public class JavaOptionsProvider implements OptionsProvider {
.put(CodegenConstants.GROUP_ID, GROUP_ID_VALUE)
.put(CodegenConstants.ARTIFACT_ID, ARTIFACT_ID_VALUE)
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
.put(CodegenConstants.ARTIFACT_URL, ARTIFACT_URL_VALUE)
.put(CodegenConstants.ARTIFACT_DESCRIPTION, ARTIFACT_DESCRIPTION_VALUE)
.put(CodegenConstants.SCM_CONNECTION, SCM_CONNECTION_VALUE)
.put(CodegenConstants.SCM_DEVELOPER_CONNECTION, SCM_DEVELOPER_CONNECTION_VALUE)
.put(CodegenConstants.SCM_URL, SCM_URL_VALUE)
.put(CodegenConstants.DEVELOPER_NAME, DEVELOPER_NAME_VALUE)
.put(CodegenConstants.DEVELOPER_EMAIL, DEVELOPER_EMAIL_VALUE)
.put(CodegenConstants.DEVELOPER_ORGANIZATION, DEVELOPER_ORGANIZATION_VALUE)
.put(CodegenConstants.DEVELOPER_ORGANIZATION_URL, DEVELOPER_ORGANIZATION_URL_VALUE)
.put(CodegenConstants.LICENSE_NAME, LICENSE_NAME_VALUE)
.put(CodegenConstants.LICENSE_URL, LICENSE_URL_VALUE)
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)

View File

@@ -15,6 +15,15 @@ public class JaxRSServerOptionsProvider implements OptionsProvider {
public static final String SORT_PARAMS_VALUE = "false";
public static final String GROUP_ID_VALUE = "io.swagger.test";
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
public static final String ARTIFACT_URL_VALUE = "https://github.com/swagger-api/swagger-codegen";
public static final String ARTIFACT_DESCRIPTION_VALUE = "Swagger Java Client Test";
public static final String DEVELOPER_NAME_VALUE = "Swagger";
public static final String DEVELOPER_EMAIL_VALUE = "apiteam@swagger.io";
public static final String DEVELOPER_ORGANIZATION_VALUE = "Swagger";
public static final String DEVELOPER_ORGANIZATION_URL_VALUE = "http://swagger.io";
public static final String SCM_CONNECTION_VALUE = "scm:git:git@github.com:swagger-api/swagger-codegen.git";
public static final String SCM_DEVELOPER_CONNECTION_VALUE = "scm:git:git@github.com:swagger-api/swagger-codegen.git";
public static final String SCM_URL_VALUE = "https://github.com/swagger-api/swagger-codegen";
public static final String LICENSE_NAME_VALUE = "Apache License, Version 2.0";
public static final String LICENSE_URL_VALUE = "http://www.apache.org/licenses/LICENSE-2.0";
public static final String SOURCE_FOLDER_VALUE = "src/main/java/test";
@@ -55,6 +64,15 @@ public class JaxRSServerOptionsProvider implements OptionsProvider {
.put(CodegenConstants.GROUP_ID, GROUP_ID_VALUE)
.put(CodegenConstants.ARTIFACT_ID, ARTIFACT_ID_VALUE)
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
.put(CodegenConstants.ARTIFACT_URL, ARTIFACT_URL_VALUE)
.put(CodegenConstants.ARTIFACT_DESCRIPTION, ARTIFACT_DESCRIPTION_VALUE)
.put(CodegenConstants.SCM_CONNECTION, SCM_CONNECTION_VALUE)
.put(CodegenConstants.SCM_DEVELOPER_CONNECTION, SCM_DEVELOPER_CONNECTION_VALUE)
.put(CodegenConstants.SCM_URL, SCM_URL_VALUE)
.put(CodegenConstants.DEVELOPER_NAME, DEVELOPER_NAME_VALUE)
.put(CodegenConstants.DEVELOPER_EMAIL, DEVELOPER_EMAIL_VALUE)
.put(CodegenConstants.DEVELOPER_ORGANIZATION, DEVELOPER_ORGANIZATION_VALUE)
.put(CodegenConstants.DEVELOPER_ORGANIZATION_URL, DEVELOPER_ORGANIZATION_URL_VALUE)
.put(CodegenConstants.LICENSE_NAME, LICENSE_NAME_VALUE)
.put(CodegenConstants.LICENSE_URL, LICENSE_URL_VALUE)
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)

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

@@ -150,6 +150,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);
@@ -187,7 +190,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()) {
@@ -202,8 +205,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()) {
@@ -223,7 +226,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()) {
@@ -237,7 +240,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()) {
@@ -251,8 +254,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()) {
@@ -266,9 +269,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()) {
@@ -288,7 +291,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()) {
@@ -300,14 +303,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

@@ -47,7 +47,6 @@ public interface FakeApi extends ApiClient.Api {
* @param dateTime None (optional)
* @param password None (optional)
* @param paramCallback None (optional)
* @return void
*/
@RequestLine("POST /fake")
@Headers({
@@ -67,7 +66,6 @@ public interface FakeApi extends ApiClient.Api {
* @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
*/
@RequestLine("GET /fake?enum_query_string_array={enumQueryStringArray}&enum_query_string={enumQueryString}&enum_query_integer={enumQueryInteger}")
@Headers({

View File

@@ -20,7 +20,6 @@ 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
*/
@RequestLine("POST /pet")
@Headers({
@@ -34,7 +33,6 @@ public interface PetApi extends ApiClient.Api {
*
* @param petId Pet id to delete (required)
* @param apiKey (optional)
* @return void
*/
@RequestLine("DELETE /pet/{petId}")
@Headers({
@@ -48,7 +46,7 @@ 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>
* @return List&lt;Pet&gt;
*/
@RequestLine("GET /pet/findByStatus?status={status}")
@Headers({
@@ -61,7 +59,7 @@ 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>
* @return List&lt;Pet&gt;
*/
@RequestLine("GET /pet/findByTags?tags={tags}")
@Headers({
@@ -87,7 +85,6 @@ 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
*/
@RequestLine("PUT /pet")
@Headers({
@@ -102,7 +99,6 @@ public interface PetApi extends ApiClient.Api {
* @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
*/
@RequestLine("POST /pet/{petId}")
@Headers({

View File

@@ -18,7 +18,6 @@ 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
*/
@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({

View File

@@ -18,7 +18,6 @@ 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
*/
@RequestLine("POST /user")
@Headers({
@@ -31,7 +30,6 @@ public interface UserApi extends ApiClient.Api {
* Creates list of users with given input array
*
* @param body List of user object (required)
* @return void
*/
@RequestLine("POST /user/createWithArray")
@Headers({
@@ -44,7 +42,6 @@ public interface UserApi extends ApiClient.Api {
* Creates list of users with given input array
*
* @param body List of user object (required)
* @return void
*/
@RequestLine("POST /user/createWithList")
@Headers({
@@ -57,7 +54,6 @@ 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
*/
@RequestLine("DELETE /user/{username}")
@Headers({
@@ -96,7 +92,6 @@ public interface UserApi extends ApiClient.Api {
/**
* Logs out current logged in user session
*
* @return void
*/
@RequestLine("GET /user/logout")
@Headers({
@@ -110,7 +105,6 @@ public interface UserApi extends ApiClient.Api {
* 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
*/
@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" )
@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"),
@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

@@ -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

@@ -0,0 +1,52 @@
# Fake_classname_tags123Api
All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testClassname**](Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
<a name="testClassname"></a>
# **testClassname**
> Client testClassname(body)
To test class name in snake case
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.Fake_classname_tags123Api;
Fake_classname_tags123Api apiInstance = new Fake_classname_tags123Api();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testClassname(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling Fake_classname_tags123Api#testClassname");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@@ -0,0 +1,52 @@
# FakeclassnametagsApi
All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testClassname**](FakeclassnametagsApi.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
<a name="testClassname"></a>
# **testClassname**
> Client testClassname(body)
To test class name in snake case
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.FakeclassnametagsApi;
FakeclassnametagsApi apiInstance = new FakeclassnametagsApi();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testClassname(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FakeclassnametagsApi#testClassname");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

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

@@ -103,6 +103,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
@@ -123,6 +124,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;
@@ -155,6 +157,7 @@ public class ApiClient {
/**
* Gets the status code of the previous request
* @return Status code
*/
public int getStatusCode() {
return statusCode;
@@ -162,6 +165,7 @@ public class ApiClient {
/**
* Gets the response headers of the previous request
* @return Response headers
*/
public Map<String, List<String>> getResponseHeaders() {
return responseHeaders;
@@ -169,6 +173,7 @@ public class ApiClient {
/**
* Get authentications (key: authentication name, value: authentication).
* @return Map of authentication
*/
public Map<String, Authentication> getAuthentications() {
return authentications;
@@ -186,6 +191,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()) {
@@ -199,6 +205,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()) {
@@ -212,6 +219,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()) {
@@ -225,6 +233,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()) {
@@ -238,6 +247,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()) {
@@ -251,6 +261,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);
@@ -262,6 +274,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);
@@ -270,6 +283,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;
@@ -279,6 +293,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;
@@ -289,6 +304,7 @@ public class ApiClient {
/**
* Connect timeout (in milliseconds).
* @return Connection timeout
*/
public int getConnectTimeout() {
return connectionTimeout;
@@ -298,6 +314,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;
@@ -307,6 +325,7 @@ public class ApiClient {
/**
* Get the date format used to parse/format date parameters.
* @return Date format
*/
public DateFormat getDateFormat() {
return dateFormat;
@@ -314,6 +333,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;
@@ -326,6 +347,8 @@ public class ApiClient {
/**
* Parse the given string into Date object.
* @param str String
* @return Date
*/
public Date parseDate(String str) {
try {
@@ -337,6 +360,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);
@@ -344,6 +369,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) {
@@ -365,7 +392,11 @@ 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>();
@@ -426,6 +457,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(;.*)?");
@@ -475,6 +508,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 {
@@ -487,6 +522,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")) {
@@ -592,6 +632,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
@@ -601,7 +642,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 {
@@ -640,6 +683,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) {
@@ -651,6 +696,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

@@ -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" )
@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"),
@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

@@ -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

@@ -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

@@ -0,0 +1,52 @@
# Fake_classname_tags123Api
All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testClassname**](Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
<a name="testClassname"></a>
# **testClassname**
> Client testClassname(body)
To test class name in snake case
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.Fake_classname_tags123Api;
Fake_classname_tags123Api apiInstance = new Fake_classname_tags123Api();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testClassname(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling Fake_classname_tags123Api#testClassname");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@@ -0,0 +1,52 @@
# FakeclassnametagsApi
All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testClassname**](FakeclassnametagsApi.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
<a name="testClassname"></a>
# **testClassname**
> Client testClassname(body)
To test class name in snake case
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.FakeclassnametagsApi;
FakeclassnametagsApi apiInstance = new FakeclassnametagsApi();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testClassname(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FakeclassnametagsApi#testClassname");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

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>
@@ -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>
@@ -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,7 +366,11 @@ 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

@@ -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" )
@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"),
@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

@@ -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

@@ -0,0 +1,52 @@
# Fake_classname_tags123Api
All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testClassname**](Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
<a name="testClassname"></a>
# **testClassname**
> Client testClassname(body)
To test class name in snake case
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.Fake_classname_tags123Api;
Fake_classname_tags123Api apiInstance = new Fake_classname_tags123Api();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testClassname(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling Fake_classname_tags123Api#testClassname");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@@ -0,0 +1,52 @@
# FakeclassnametagsApi
All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testClassname**](FakeclassnametagsApi.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
<a name="testClassname"></a>
# **testClassname**
> Client testClassname(body)
To test class name in snake case
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.FakeclassnametagsApi;
FakeclassnametagsApi apiInstance = new FakeclassnametagsApi();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testClassname(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FakeclassnametagsApi#testClassname");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

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>
@@ -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>
@@ -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,7 +366,11 @@ 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

@@ -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" )
@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"),
@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

@@ -1,18 +1,6 @@
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
language: java
jdk:
- oraclejdk8

View File

@@ -4,8 +4,6 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**className** | **String** | |
**color** | **String** | | [optional]
**declawed** | **Boolean** | | [optional]

View File

@@ -0,0 +1,10 @@
# Client
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**client** | **String** | | [optional]

View File

@@ -4,8 +4,6 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**className** | **String** | |
**color** | **String** | | [optional]
**breed** | **String** | | [optional]

View File

@@ -0,0 +1,27 @@
# EnumArrays
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional]
**arrayEnum** | [**List&lt;ArrayEnumEnum&gt;**](#List&lt;ArrayEnumEnum&gt;) | | [optional]
<a name="JustSymbolEnum"></a>
## Enum: JustSymbolEnum
Name | Value
---- | -----
GREATER_THAN_OR_EQUAL_TO | &quot;&gt;&#x3D;&quot;
DOLLAR | &quot;$&quot;
<a name="List<ArrayEnumEnum>"></a>
## Enum: List&lt;ArrayEnumEnum&gt;
Name | Value
---- | -----
FISH | &quot;fish&quot;
CRAB | &quot;crab&quot;

View File

@@ -7,6 +7,7 @@ Name | Type | Description | Notes
**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional]
**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional]
**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional]
<a name="EnumStringEnum"></a>

View File

@@ -4,17 +4,18 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \&quot;client\&quot; model
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters
[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
<a name="testEndpointParameters"></a>
# **testEndpointParameters**
> testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password)
<a name="testClientModel"></a>
# **testClientModel**
> Client testClientModel(body)
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
To test \&quot;client\&quot; model
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
To test \&quot;client\&quot; model
### Example
```java
@@ -23,21 +24,77 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
//import io.swagger.client.api.FakeApi;
FakeApi apiInstance = new FakeApi();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testClientModel(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#testClientModel");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
<a name="testEndpointParameters"></a>
# **testEndpointParameters**
> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback)
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
### Example
```java
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.FakeApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: http_basic_test
HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test");
http_basic_test.setUsername("YOUR USERNAME");
http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi();
BigDecimal number = new BigDecimal(); // BigDecimal | None
Double _double = 3.4D; // Double | None
String string = "string_example"; // String | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = B; // byte[] | None
Integer integer = 56; // Integer | None
Integer int32 = 56; // Integer | None
Long int64 = 789L; // Long | None
Float _float = 3.4F; // Float | None
String string = "string_example"; // String | None
byte[] binary = B; // byte[] | None
LocalDate date = new LocalDate(); // LocalDate | None
DateTime dateTime = new DateTime(); // DateTime | None
String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None
try {
apiInstance.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#testEndpointParameters");
e.printStackTrace();
@@ -50,16 +107,18 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**number** | **BigDecimal**| None |
**_double** | **Double**| None |
**string** | **String**| None |
**patternWithoutDelimiter** | **String**| None |
**_byte** | **byte[]**| None |
**integer** | **Integer**| None | [optional]
**int32** | **Integer**| None | [optional]
**int64** | **Long**| None | [optional]
**_float** | **Float**| None | [optional]
**string** | **String**| None | [optional]
**binary** | **byte[]**| None | [optional]
**date** | **LocalDate**| None | [optional]
**dateTime** | **DateTime**| None | [optional]
**password** | **String**| None | [optional]
**paramCallback** | **String**| None | [optional]
### Return type
@@ -67,18 +126,20 @@ null (empty response body)
### Authorization
No authorization required
[http_basic_test](../README.md#http_basic_test)
### HTTP request headers
- **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
- **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
<a name="testEnumQueryParameters"></a>
# **testEnumQueryParameters**
> testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble)
<a name="testEnumParameters"></a>
# **testEnumParameters**
> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble)
To test enum query parameters
To test enum parameters
To test enum parameters
### Example
```java
@@ -88,13 +149,18 @@ To test enum query parameters
FakeApi apiInstance = new FakeApi();
List<String> enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List<String> | Form parameter enum test (string array)
String enumFormString = "-efg"; // String | Form parameter enum test (string)
List<String> enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List<String> | Header parameter enum test (string array)
String enumHeaderString = "-efg"; // String | Header parameter enum test (string)
List<String> enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List<String> | Query parameter enum test (string array)
String enumQueryString = "-efg"; // String | Query parameter enum test (string)
BigDecimal enumQueryInteger = new BigDecimal(); // BigDecimal | Query parameter enum test (double)
Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double)
Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double)
try {
apiInstance.testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble);
apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#testEnumQueryParameters");
System.err.println("Exception when calling FakeApi#testEnumParameters");
e.printStackTrace();
}
```
@@ -103,8 +169,13 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enumFormStringArray** | [**List&lt;String&gt;**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $]
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumHeaderStringArray** | [**List&lt;String&gt;**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $]
**enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryStringArray** | [**List&lt;String&gt;**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $]
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryInteger** | **BigDecimal**| Query parameter enum test (double) | [optional]
**enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional]
**enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional]
### Return type
@@ -117,6 +188,6 @@ No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
- **Content-Type**: */*
- **Accept**: */*

View File

@@ -0,0 +1,52 @@
# FakeclassnametagsApi
All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testClassname**](FakeclassnametagsApi.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
<a name="testClassname"></a>
# **testClassname**
> Client testClassname(body)
To test class name in snake case
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.FakeclassnametagsApi;
FakeclassnametagsApi apiInstance = new FakeclassnametagsApi();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testClassname(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FakeclassnametagsApi#testClassname");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@@ -12,6 +12,8 @@ Name | Type | Description | Notes
## Enum: Map&lt;String, InnerEnum&gt;
Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;

View File

@@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **Integer** | | [optional]
**PropertyClass** | **String** | | [optional]
**propertyClass** | **String** | | [optional]

View File

@@ -158,7 +158,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | [**List&lt;String&gt;**](String.md)| Status values that need to be considered for filter |
**status** | [**List&lt;String&gt;**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type

View File

@@ -0,0 +1,395 @@
<!-- ====================================================================== -->
<!-- -->
<!-- Generated by Maven Help Plugin on 2017-01-21T07:16:46 -->
<!-- See: http://maven.apache.org/plugins/maven-help-plugin/ -->
<!-- -->
<!-- ====================================================================== -->
<!-- ====================================================================== -->
<!-- -->
<!-- Effective POM for project -->
<!-- 'io.swagger:petstore-okhttp-gson-parcelable: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>petstore-okhttp-gson-parcelable</artifactId>
<version>1.0.0</version>
<name>petstore-okhttp-gson-parcelable</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>
<gson-version>2.6.2</gson-version>
<java.version>1.7</java.version>
<jodatime-version>2.9.3</jodatime-version>
<junit-version>4.12</junit-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<okhttp-version>2.7.5</okhttp-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<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>com.squareup.okhttp</groupId>
<artifactId>okhttp</artifactId>
<version>2.7.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp</groupId>
<artifactId>logging-interceptor</artifactId>
<version>2.7.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.6.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.3</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/okhttp-gson-parcelableModel/src/main/java</sourceDirectory>
<scriptSourceDirectory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/scripts</scriptSourceDirectory>
<testSourceDirectory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java</testSourceDirectory>
<outputDirectory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/target/classes</outputDirectory>
<testOutputDirectory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/target/test-classes</testOutputDirectory>
<resources>
<resource>
<directory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/resources</directory>
</testResource>
</testResources>
<directory>/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/java/okhttp-gson-parcelableModel/target</directory>
<finalName>petstore-okhttp-gson-parcelable-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/okhttp-gson-parcelableModel/target/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</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.10</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>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>gradle-test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>gradle</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
</execution>
</executions>
</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-compiler-plugin</artifactId>
<version>3.1</version>
<executions>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>default-testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</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/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/target/site</outputDirectory>
</reporting>
</project>

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -38,10 +26,11 @@ import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import io.swagger.client.model.Client;
import org.joda.time.LocalDate;
import org.joda.time.DateTime;
import java.math.BigDecimal;
import io.swagger.client.model.Client;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import java.lang.reflect.Type;
import java.util.ArrayList;
@@ -72,12 +61,6 @@ public class FakeApi {
private com.squareup.okhttp.Call testClientModelCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling testClientModel(Async)");
}
// create path and map variables
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
@@ -113,11 +96,29 @@ public class FakeApi {
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call testClientModelValidateBeforeCall(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 testClientModel(Async)");
}
com.squareup.okhttp.Call call = testClientModelCall(body, progressListener, progressRequestListener);
return call;
}
/**
* To test \&quot;client\&quot; model
*
* To test \&quot;client\&quot; model
* @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
@@ -129,20 +130,20 @@ public class FakeApi {
/**
* To test \&quot;client\&quot; model
*
* To test \&quot;client\&quot; model
* @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> testClientModelWithHttpInfo(Client body) throws ApiException {
com.squareup.okhttp.Call call = testClientModelCall(body, null, null);
com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(body, null, null);
Type localVarReturnType = new TypeToken<Client>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* To test \&quot;client\&quot; model (asynchronously)
*
* To test \&quot;client\&quot; model
* @param body client model (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
@@ -169,7 +170,7 @@ public class FakeApi {
};
}
com.squareup.okhttp.Call call = testClientModelCall(body, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(body, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Client>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
@@ -178,27 +179,6 @@ public class FakeApi {
private com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, DateTime dateTime, String password, String paramCallback, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'number' is set
if (number == null) {
throw new ApiException("Missing the required parameter 'number' when calling testEndpointParameters(Async)");
}
// verify the required parameter '_double' is set
if (_double == null) {
throw new ApiException("Missing the required parameter '_double' when calling testEndpointParameters(Async)");
}
// verify the required parameter 'patternWithoutDelimiter' is set
if (patternWithoutDelimiter == null) {
throw new ApiException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters(Async)");
}
// verify the required parameter '_byte' is set
if (_byte == null) {
throw new ApiException("Missing the required parameter '_byte' when calling testEndpointParameters(Async)");
}
// create path and map variables
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
@@ -262,6 +242,39 @@ public class FakeApi {
String[] localVarAuthNames = new String[] { "http_basic_test" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call testEndpointParametersValidateBeforeCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, DateTime dateTime, String password, String paramCallback, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'number' is set
if (number == null) {
throw new ApiException("Missing the required parameter 'number' when calling testEndpointParameters(Async)");
}
// verify the required parameter '_double' is set
if (_double == null) {
throw new ApiException("Missing the required parameter '_double' when calling testEndpointParameters(Async)");
}
// verify the required parameter 'patternWithoutDelimiter' is set
if (patternWithoutDelimiter == null) {
throw new ApiException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters(Async)");
}
// verify the required parameter '_byte' is set
if (_byte == null) {
throw new ApiException("Missing the required parameter '_byte' when calling testEndpointParameters(Async)");
}
com.squareup.okhttp.Call call = testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, progressListener, progressRequestListener);
return call;
}
/**
@@ -308,7 +321,7 @@ public class FakeApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, DateTime dateTime, String password, String paramCallback) throws ApiException {
com.squareup.okhttp.Call call = testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, null, null);
com.squareup.okhttp.Call call = testEndpointParametersValidateBeforeCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, null, null);
return apiClient.execute(call);
}
@@ -354,15 +367,14 @@ public class FakeApi {
};
}
com.squareup.okhttp.Call call = testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = testEndpointParametersValidateBeforeCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/* Build call for testEnumParameters */
private com.squareup.okhttp.Call testEnumParametersCall(List<String> enumFormStringArray, String enumFormString, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
private com.squareup.okhttp.Call testEnumParametersCall(List<String> enumFormStringArray, String enumFormString, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
@@ -389,13 +401,13 @@ public class FakeApi {
localVarFormParams.put("enum_query_double", enumQueryDouble);
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);
@@ -414,11 +426,24 @@ public class FakeApi {
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call testEnumParametersValidateBeforeCall(List<String> enumFormStringArray, String enumFormString, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = testEnumParametersCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, progressListener, progressRequestListener);
return call;
}
/**
* 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)
@@ -429,13 +454,13 @@ public class FakeApi {
* @param enumQueryDouble Query parameter enum test (double) (optional)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void testEnumParameters(List<String> enumFormStringArray, String enumFormString, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble) throws ApiException {
public void testEnumParameters(List<String> enumFormStringArray, String enumFormString, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException {
testEnumParametersWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble);
}
/**
* 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)
@@ -447,14 +472,14 @@ public class FakeApi {
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> testEnumParametersWithHttpInfo(List<String> enumFormStringArray, String enumFormString, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble) throws ApiException {
com.squareup.okhttp.Call call = testEnumParametersCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, null, null);
public ApiResponse<Void> testEnumParametersWithHttpInfo(List<String> enumFormStringArray, String enumFormString, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException {
com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, null, null);
return apiClient.execute(call);
}
/**
* To test enum parameters (asynchronously)
*
* 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)
@@ -467,7 +492,7 @@ public class FakeApi {
* @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 testEnumParametersAsync(List<String> enumFormStringArray, String enumFormString, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble, final ApiCallback<Void> callback) throws ApiException {
public com.squareup.okhttp.Call testEnumParametersAsync(List<String> enumFormStringArray, String enumFormString, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
@@ -488,7 +513,7 @@ public class FakeApi {
};
}
com.squareup.okhttp.Call call = testEnumParametersCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -38,9 +26,10 @@ import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import io.swagger.client.model.Pet;
import java.io.File;
import io.swagger.client.model.ModelApiResponse;
import io.swagger.client.model.Pet;
import java.lang.reflect.Type;
import java.util.ArrayList;
@@ -71,12 +60,6 @@ public class PetApi {
private com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling addPet(Async)");
}
// create path and map variables
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
@@ -112,6 +95,24 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call addPetValidateBeforeCall(Pet 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 addPet(Async)");
}
com.squareup.okhttp.Call call = addPetCall(body, progressListener, progressRequestListener);
return call;
}
/**
@@ -132,7 +133,7 @@ public class PetApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> addPetWithHttpInfo(Pet body) throws ApiException {
com.squareup.okhttp.Call call = addPetCall(body, null, null);
com.squareup.okhttp.Call call = addPetValidateBeforeCall(body, null, null);
return apiClient.execute(call);
}
@@ -165,7 +166,7 @@ public class PetApi {
};
}
com.squareup.okhttp.Call call = addPetCall(body, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = addPetValidateBeforeCall(body, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
@@ -173,12 +174,6 @@ public class PetApi {
private com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException("Missing the required parameter 'petId' when calling deletePet(Async)");
}
// create path and map variables
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
@@ -217,6 +212,24 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call deletePetValidateBeforeCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException("Missing the required parameter 'petId' when calling deletePet(Async)");
}
com.squareup.okhttp.Call call = deletePetCall(petId, apiKey, progressListener, progressRequestListener);
return call;
}
/**
@@ -239,7 +252,7 @@ public class PetApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException {
com.squareup.okhttp.Call call = deletePetCall(petId, apiKey, null, null);
com.squareup.okhttp.Call call = deletePetValidateBeforeCall(petId, apiKey, null, null);
return apiClient.execute(call);
}
@@ -273,7 +286,7 @@ public class PetApi {
};
}
com.squareup.okhttp.Call call = deletePetCall(petId, apiKey, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = deletePetValidateBeforeCall(petId, apiKey, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
@@ -281,12 +294,6 @@ public class PetApi {
private com.squareup.okhttp.Call findPetsByStatusCall(List<String> status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'status' is set
if (status == null) {
throw new ApiException("Missing the required parameter 'status' when calling findPetsByStatus(Async)");
}
// create path and map variables
String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json");
@@ -324,6 +331,24 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call findPetsByStatusValidateBeforeCall(List<String> status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'status' is set
if (status == null) {
throw new ApiException("Missing the required parameter 'status' when calling findPetsByStatus(Async)");
}
com.squareup.okhttp.Call call = findPetsByStatusCall(status, progressListener, progressRequestListener);
return call;
}
/**
@@ -346,7 +371,7 @@ public class PetApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<List<Pet>> findPetsByStatusWithHttpInfo(List<String> status) throws ApiException {
com.squareup.okhttp.Call call = findPetsByStatusCall(status, null, null);
com.squareup.okhttp.Call call = findPetsByStatusValidateBeforeCall(status, null, null);
Type localVarReturnType = new TypeToken<List<Pet>>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
@@ -380,7 +405,7 @@ public class PetApi {
};
}
com.squareup.okhttp.Call call = findPetsByStatusCall(status, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = findPetsByStatusValidateBeforeCall(status, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<List<Pet>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
@@ -389,12 +414,6 @@ public class PetApi {
private com.squareup.okhttp.Call findPetsByTagsCall(List<String> tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'tags' is set
if (tags == null) {
throw new ApiException("Missing the required parameter 'tags' when calling findPetsByTags(Async)");
}
// create path and map variables
String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json");
@@ -432,6 +451,24 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call findPetsByTagsValidateBeforeCall(List<String> tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'tags' is set
if (tags == null) {
throw new ApiException("Missing the required parameter 'tags' when calling findPetsByTags(Async)");
}
com.squareup.okhttp.Call call = findPetsByTagsCall(tags, progressListener, progressRequestListener);
return call;
}
/**
@@ -454,7 +491,7 @@ public class PetApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<List<Pet>> findPetsByTagsWithHttpInfo(List<String> tags) throws ApiException {
com.squareup.okhttp.Call call = findPetsByTagsCall(tags, null, null);
com.squareup.okhttp.Call call = findPetsByTagsValidateBeforeCall(tags, null, null);
Type localVarReturnType = new TypeToken<List<Pet>>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
@@ -488,7 +525,7 @@ public class PetApi {
};
}
com.squareup.okhttp.Call call = findPetsByTagsCall(tags, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = findPetsByTagsValidateBeforeCall(tags, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<List<Pet>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
@@ -497,12 +534,6 @@ public class PetApi {
private com.squareup.okhttp.Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException("Missing the required parameter 'petId' when calling getPetById(Async)");
}
// create path and map variables
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
@@ -539,6 +570,24 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "api_key" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call getPetByIdValidateBeforeCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException("Missing the required parameter 'petId' when calling getPetById(Async)");
}
com.squareup.okhttp.Call call = getPetByIdCall(petId, progressListener, progressRequestListener);
return call;
}
/**
@@ -561,7 +610,7 @@ public class PetApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Pet> getPetByIdWithHttpInfo(Long petId) throws ApiException {
com.squareup.okhttp.Call call = getPetByIdCall(petId, null, null);
com.squareup.okhttp.Call call = getPetByIdValidateBeforeCall(petId, null, null);
Type localVarReturnType = new TypeToken<Pet>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
@@ -595,7 +644,7 @@ public class PetApi {
};
}
com.squareup.okhttp.Call call = getPetByIdCall(petId, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = getPetByIdValidateBeforeCall(petId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Pet>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
@@ -604,12 +653,6 @@ public class PetApi {
private com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling updatePet(Async)");
}
// create path and map variables
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
@@ -645,6 +688,24 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" };
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call updatePetValidateBeforeCall(Pet 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 updatePet(Async)");
}
com.squareup.okhttp.Call call = updatePetCall(body, progressListener, progressRequestListener);
return call;
}
/**
@@ -665,7 +726,7 @@ public class PetApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> updatePetWithHttpInfo(Pet body) throws ApiException {
com.squareup.okhttp.Call call = updatePetCall(body, null, null);
com.squareup.okhttp.Call call = updatePetValidateBeforeCall(body, null, null);
return apiClient.execute(call);
}
@@ -698,7 +759,7 @@ public class PetApi {
};
}
com.squareup.okhttp.Call call = updatePetCall(body, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = updatePetValidateBeforeCall(body, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
@@ -706,12 +767,6 @@ public class PetApi {
private com.squareup.okhttp.Call updatePetWithFormCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException("Missing the required parameter 'petId' when calling updatePetWithForm(Async)");
}
// create path and map variables
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
@@ -752,6 +807,24 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call updatePetWithFormValidateBeforeCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException("Missing the required parameter 'petId' when calling updatePetWithForm(Async)");
}
com.squareup.okhttp.Call call = updatePetWithFormCall(petId, name, status, progressListener, progressRequestListener);
return call;
}
/**
@@ -776,7 +849,7 @@ public class PetApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException {
com.squareup.okhttp.Call call = updatePetWithFormCall(petId, name, status, null, null);
com.squareup.okhttp.Call call = updatePetWithFormValidateBeforeCall(petId, name, status, null, null);
return apiClient.execute(call);
}
@@ -811,7 +884,7 @@ public class PetApi {
};
}
com.squareup.okhttp.Call call = updatePetWithFormCall(petId, name, status, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = updatePetWithFormValidateBeforeCall(petId, name, status, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
@@ -819,12 +892,6 @@ public class PetApi {
private com.squareup.okhttp.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException("Missing the required parameter 'petId' when calling uploadFile(Async)");
}
// create path and map variables
String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
@@ -865,6 +932,24 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call uploadFileValidateBeforeCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException("Missing the required parameter 'petId' when calling uploadFile(Async)");
}
com.squareup.okhttp.Call call = uploadFileCall(petId, additionalMetadata, file, progressListener, progressRequestListener);
return call;
}
/**
@@ -891,7 +976,7 @@ public class PetApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException {
com.squareup.okhttp.Call call = uploadFileCall(petId, additionalMetadata, file, null, null);
com.squareup.okhttp.Call call = uploadFileValidateBeforeCall(petId, additionalMetadata, file, null, null);
Type localVarReturnType = new TypeToken<ModelApiResponse>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
@@ -927,7 +1012,7 @@ public class PetApi {
};
}
com.squareup.okhttp.Call call = uploadFileCall(petId, additionalMetadata, file, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = uploadFileValidateBeforeCall(petId, additionalMetadata, file, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<ModelApiResponse>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -38,6 +26,7 @@ import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import io.swagger.client.model.Order;
import java.lang.reflect.Type;
@@ -69,12 +58,6 @@ public class StoreApi {
private com.squareup.okhttp.Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException("Missing the required parameter 'orderId' when calling deleteOrder(Async)");
}
// create path and map variables
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
@@ -111,6 +94,24 @@ public class StoreApi {
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call deleteOrderValidateBeforeCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException("Missing the required parameter 'orderId' when calling deleteOrder(Async)");
}
com.squareup.okhttp.Call call = deleteOrderCall(orderId, progressListener, progressRequestListener);
return call;
}
/**
@@ -131,7 +132,7 @@ public class StoreApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> deleteOrderWithHttpInfo(String orderId) throws ApiException {
com.squareup.okhttp.Call call = deleteOrderCall(orderId, null, null);
com.squareup.okhttp.Call call = deleteOrderValidateBeforeCall(orderId, null, null);
return apiClient.execute(call);
}
@@ -164,7 +165,7 @@ public class StoreApi {
};
}
com.squareup.okhttp.Call call = deleteOrderCall(orderId, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = deleteOrderValidateBeforeCall(orderId, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
@@ -172,7 +173,6 @@ public class StoreApi {
private com.squareup.okhttp.Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json");
@@ -208,6 +208,19 @@ public class StoreApi {
String[] localVarAuthNames = new String[] { "api_key" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call getInventoryValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = getInventoryCall(progressListener, progressRequestListener);
return call;
}
/**
@@ -228,7 +241,7 @@ public class StoreApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Map<String, Integer>> getInventoryWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = getInventoryCall(null, null);
com.squareup.okhttp.Call call = getInventoryValidateBeforeCall(null, null);
Type localVarReturnType = new TypeToken<Map<String, Integer>>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
@@ -261,7 +274,7 @@ public class StoreApi {
};
}
com.squareup.okhttp.Call call = getInventoryCall(progressListener, progressRequestListener);
com.squareup.okhttp.Call call = getInventoryValidateBeforeCall(progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Map<String, Integer>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
@@ -270,12 +283,6 @@ public class StoreApi {
private com.squareup.okhttp.Call getOrderByIdCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException("Missing the required parameter 'orderId' when calling getOrderById(Async)");
}
// create path and map variables
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
@@ -312,6 +319,24 @@ public class StoreApi {
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call getOrderByIdValidateBeforeCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException("Missing the required parameter 'orderId' when calling getOrderById(Async)");
}
com.squareup.okhttp.Call call = getOrderByIdCall(orderId, progressListener, progressRequestListener);
return call;
}
/**
@@ -334,7 +359,7 @@ public class StoreApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Order> getOrderByIdWithHttpInfo(Long orderId) throws ApiException {
com.squareup.okhttp.Call call = getOrderByIdCall(orderId, null, null);
com.squareup.okhttp.Call call = getOrderByIdValidateBeforeCall(orderId, null, null);
Type localVarReturnType = new TypeToken<Order>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
@@ -368,7 +393,7 @@ public class StoreApi {
};
}
com.squareup.okhttp.Call call = getOrderByIdCall(orderId, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = getOrderByIdValidateBeforeCall(orderId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Order>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
@@ -377,12 +402,6 @@ public class StoreApi {
private com.squareup.okhttp.Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling placeOrder(Async)");
}
// create path and map variables
String localVarPath = "/store/order".replaceAll("\\{format\\}","json");
@@ -418,6 +437,24 @@ public class StoreApi {
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call placeOrderValidateBeforeCall(Order 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 placeOrder(Async)");
}
com.squareup.okhttp.Call call = placeOrderCall(body, progressListener, progressRequestListener);
return call;
}
/**
@@ -440,7 +477,7 @@ public class StoreApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Order> placeOrderWithHttpInfo(Order body) throws ApiException {
com.squareup.okhttp.Call call = placeOrderCall(body, null, null);
com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(body, null, null);
Type localVarReturnType = new TypeToken<Order>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
@@ -474,7 +511,7 @@ public class StoreApi {
};
}
com.squareup.okhttp.Call call = placeOrderCall(body, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(body, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Order>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -38,6 +26,7 @@ import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import io.swagger.client.model.User;
import java.lang.reflect.Type;
@@ -69,12 +58,6 @@ public class UserApi {
private com.squareup.okhttp.Call createUserCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling createUser(Async)");
}
// create path and map variables
String localVarPath = "/user".replaceAll("\\{format\\}","json");
@@ -110,6 +93,24 @@ public class UserApi {
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call createUserValidateBeforeCall(User 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 createUser(Async)");
}
com.squareup.okhttp.Call call = createUserCall(body, progressListener, progressRequestListener);
return call;
}
/**
@@ -130,7 +131,7 @@ public class UserApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> createUserWithHttpInfo(User body) throws ApiException {
com.squareup.okhttp.Call call = createUserCall(body, null, null);
com.squareup.okhttp.Call call = createUserValidateBeforeCall(body, null, null);
return apiClient.execute(call);
}
@@ -163,7 +164,7 @@ public class UserApi {
};
}
com.squareup.okhttp.Call call = createUserCall(body, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = createUserValidateBeforeCall(body, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
@@ -171,12 +172,6 @@ public class UserApi {
private com.squareup.okhttp.Call createUsersWithArrayInputCall(List<User> body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling createUsersWithArrayInput(Async)");
}
// create path and map variables
String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json");
@@ -212,6 +207,24 @@ public class UserApi {
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call createUsersWithArrayInputValidateBeforeCall(List<User> 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 createUsersWithArrayInput(Async)");
}
com.squareup.okhttp.Call call = createUsersWithArrayInputCall(body, progressListener, progressRequestListener);
return call;
}
/**
@@ -232,7 +245,7 @@ public class UserApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> createUsersWithArrayInputWithHttpInfo(List<User> body) throws ApiException {
com.squareup.okhttp.Call call = createUsersWithArrayInputCall(body, null, null);
com.squareup.okhttp.Call call = createUsersWithArrayInputValidateBeforeCall(body, null, null);
return apiClient.execute(call);
}
@@ -265,7 +278,7 @@ public class UserApi {
};
}
com.squareup.okhttp.Call call = createUsersWithArrayInputCall(body, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = createUsersWithArrayInputValidateBeforeCall(body, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
@@ -273,12 +286,6 @@ public class UserApi {
private com.squareup.okhttp.Call createUsersWithListInputCall(List<User> body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling createUsersWithListInput(Async)");
}
// create path and map variables
String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json");
@@ -314,6 +321,24 @@ public class UserApi {
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call createUsersWithListInputValidateBeforeCall(List<User> 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 createUsersWithListInput(Async)");
}
com.squareup.okhttp.Call call = createUsersWithListInputCall(body, progressListener, progressRequestListener);
return call;
}
/**
@@ -334,7 +359,7 @@ public class UserApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> createUsersWithListInputWithHttpInfo(List<User> body) throws ApiException {
com.squareup.okhttp.Call call = createUsersWithListInputCall(body, null, null);
com.squareup.okhttp.Call call = createUsersWithListInputValidateBeforeCall(body, null, null);
return apiClient.execute(call);
}
@@ -367,7 +392,7 @@ public class UserApi {
};
}
com.squareup.okhttp.Call call = createUsersWithListInputCall(body, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = createUsersWithListInputValidateBeforeCall(body, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
@@ -375,12 +400,6 @@ public class UserApi {
private com.squareup.okhttp.Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling deleteUser(Async)");
}
// create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
@@ -417,6 +436,24 @@ public class UserApi {
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call deleteUserValidateBeforeCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling deleteUser(Async)");
}
com.squareup.okhttp.Call call = deleteUserCall(username, progressListener, progressRequestListener);
return call;
}
/**
@@ -437,7 +474,7 @@ public class UserApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> deleteUserWithHttpInfo(String username) throws ApiException {
com.squareup.okhttp.Call call = deleteUserCall(username, null, null);
com.squareup.okhttp.Call call = deleteUserValidateBeforeCall(username, null, null);
return apiClient.execute(call);
}
@@ -470,7 +507,7 @@ public class UserApi {
};
}
com.squareup.okhttp.Call call = deleteUserCall(username, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = deleteUserValidateBeforeCall(username, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
@@ -478,12 +515,6 @@ public class UserApi {
private com.squareup.okhttp.Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling getUserByName(Async)");
}
// create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
@@ -520,6 +551,24 @@ public class UserApi {
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call getUserByNameValidateBeforeCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling getUserByName(Async)");
}
com.squareup.okhttp.Call call = getUserByNameCall(username, progressListener, progressRequestListener);
return call;
}
/**
@@ -542,7 +591,7 @@ public class UserApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<User> getUserByNameWithHttpInfo(String username) throws ApiException {
com.squareup.okhttp.Call call = getUserByNameCall(username, null, null);
com.squareup.okhttp.Call call = getUserByNameValidateBeforeCall(username, null, null);
Type localVarReturnType = new TypeToken<User>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
@@ -576,7 +625,7 @@ public class UserApi {
};
}
com.squareup.okhttp.Call call = getUserByNameCall(username, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = getUserByNameValidateBeforeCall(username, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<User>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
@@ -585,17 +634,6 @@ public class UserApi {
private com.squareup.okhttp.Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling loginUser(Async)");
}
// verify the required parameter 'password' is set
if (password == null) {
throw new ApiException("Missing the required parameter 'password' when calling loginUser(Async)");
}
// create path and map variables
String localVarPath = "/user/login".replaceAll("\\{format\\}","json");
@@ -635,6 +673,29 @@ public class UserApi {
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call loginUserValidateBeforeCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling loginUser(Async)");
}
// verify the required parameter 'password' is set
if (password == null) {
throw new ApiException("Missing the required parameter 'password' when calling loginUser(Async)");
}
com.squareup.okhttp.Call call = loginUserCall(username, password, progressListener, progressRequestListener);
return call;
}
/**
@@ -659,7 +720,7 @@ public class UserApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<String> loginUserWithHttpInfo(String username, String password) throws ApiException {
com.squareup.okhttp.Call call = loginUserCall(username, password, null, null);
com.squareup.okhttp.Call call = loginUserValidateBeforeCall(username, password, null, null);
Type localVarReturnType = new TypeToken<String>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
@@ -694,7 +755,7 @@ public class UserApi {
};
}
com.squareup.okhttp.Call call = loginUserCall(username, password, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = loginUserValidateBeforeCall(username, password, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<String>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
@@ -703,7 +764,6 @@ public class UserApi {
private com.squareup.okhttp.Call logoutUserCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/user/logout".replaceAll("\\{format\\}","json");
@@ -739,6 +799,19 @@ public class UserApi {
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call logoutUserValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = logoutUserCall(progressListener, progressRequestListener);
return call;
}
/**
@@ -757,7 +830,7 @@ public class UserApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> logoutUserWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = logoutUserCall(null, null);
com.squareup.okhttp.Call call = logoutUserValidateBeforeCall(null, null);
return apiClient.execute(call);
}
@@ -789,7 +862,7 @@ public class UserApi {
};
}
com.squareup.okhttp.Call call = logoutUserCall(progressListener, progressRequestListener);
com.squareup.okhttp.Call call = logoutUserValidateBeforeCall(progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
@@ -797,17 +870,6 @@ public class UserApi {
private com.squareup.okhttp.Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling updateUser(Async)");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling updateUser(Async)");
}
// create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
@@ -844,6 +906,29 @@ public class UserApi {
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call updateUserValidateBeforeCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling updateUser(Async)");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling updateUser(Async)");
}
com.squareup.okhttp.Call call = updateUserCall(username, body, progressListener, progressRequestListener);
return call;
}
/**
@@ -866,7 +951,7 @@ public class UserApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> updateUserWithHttpInfo(String username, User body) throws ApiException {
com.squareup.okhttp.Call call = updateUserCall(username, body, null, null);
com.squareup.okhttp.Call call = updateUserValidateBeforeCall(username, body, null, null);
return apiClient.execute(call);
}
@@ -900,7 +985,7 @@ public class UserApi {
};
}
com.squareup.okhttp.Call call = updateUserCall(username, body, progressListener, progressRequestListener);
com.squareup.okhttp.Call call = updateUserValidateBeforeCall(username, body, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -111,6 +99,7 @@ public class AdditionalPropertiesClass implements Parcelable {
return Objects.hash(mapProperty, mapOfMapProperty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -36,6 +24,7 @@ import android.os.Parcel;
* Animal
*/
public class Animal implements Parcelable {
@SerializedName("className")
private String className = null;
@@ -98,6 +87,7 @@ public class Animal implements Parcelable {
return Objects.hash(className, color);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -46,7 +34,7 @@ public class AnimalFarm extends ArrayList<Animal> implements Parcelable {
if (o == null || getClass() != o.getClass()) {
return false;
}
return true;
return super.equals(o);
}
@Override
@@ -54,6 +42,7 @@ public class AnimalFarm extends ArrayList<Animal> implements Parcelable {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -84,6 +72,7 @@ public class ArrayOfArrayOfNumberOnly implements Parcelable {
return Objects.hash(arrayArrayNumber);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -84,6 +72,7 @@ public class ArrayOfNumberOnly implements Parcelable {
return Objects.hash(arrayNumber);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -138,6 +126,7 @@ public class ArrayTest implements Parcelable {
return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -38,13 +26,6 @@ import android.os.Parcel;
*/
public class Cat extends Animal implements Parcelable {
@SerializedName("className")
private String className = null;
@SerializedName("color")
private String color = "red";
>>>>>>> fix bug with parcelable:samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java
@SerializedName("declawed")
private Boolean declawed = null;
@@ -85,6 +66,7 @@ public class Cat extends Animal implements Parcelable {
return Objects.hash(declawed, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@@ -108,10 +90,6 @@ public class Cat extends Animal implements Parcelable {
public void writeToParcel(Parcel out, int flags) {
super.writeToParcel(out, flags);
out.writeValue(className);
out.writeValue(color);
out.writeValue(declawed);
}
@@ -121,8 +99,6 @@ public class Cat extends Animal implements Parcelable {
Cat(Parcel in) {
super(in);
className = (String)in.readValue(null);
color = (String)in.readValue(null);
declawed = (Boolean)in.readValue(null);
}

View File

@@ -8,18 +8,6 @@
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -98,6 +86,7 @@ public class Category implements Parcelable {
return Objects.hash(id, name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@@ -0,0 +1,116 @@
/*
* 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;
import android.os.Parcelable;
import android.os.Parcel;
/**
* Client
*/
public class Client implements Parcelable {
@SerializedName("client")
private String client = null;
public Client client(String client) {
this.client = client;
return this;
}
/**
* Get client
* @return client
**/
@ApiModelProperty(example = "null", value = "")
public String getClient() {
return client;
}
public void setClient(String client) {
this.client = client;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Client client = (Client) o;
return Objects.equals(this.client, client.client);
}
@Override
public int hashCode() {
return Objects.hash(client);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Client {\n");
sb.append(" client: ").append(toIndentedString(client)).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 ");
}
public void writeToParcel(Parcel out, int flags) {
out.writeValue(client);
}
public Client() {
super();
}
Client(Parcel in) {
client = (String)in.readValue(null);
}
public int describeContents() {
return 0;
}
public static final Parcelable.Creator<Client> CREATOR = new Parcelable.Creator<Client>() {
public Client createFromParcel(Parcel in) {
return new Client(in);
}
public Client[] newArray(int size) {
return new Client[size];
}
};
}

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