Merge branch 'jfiala-beanval_2549'

This commit is contained in:
wing328
2016-12-13 00:05:03 +08:00
34 changed files with 803 additions and 439 deletions

View File

@@ -1,18 +1,29 @@
package io.swagger.codegen.languages; package io.swagger.codegen.languages;
import io.swagger.codegen.*; import java.io.File;
import io.swagger.codegen.languages.features.BeanValidationFeatures; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.io.File; import io.swagger.codegen.CliOption;
import java.util.*; import io.swagger.codegen.CodegenConstants;
import java.util.regex.Pattern; import io.swagger.codegen.CodegenModel;
import io.swagger.codegen.CodegenOperation;
import io.swagger.codegen.CodegenProperty;
import io.swagger.codegen.CodegenType;
import io.swagger.codegen.SupportingFile;
import io.swagger.codegen.languages.features.BeanValidationFeatures;
import io.swagger.codegen.languages.features.PerformBeanValidationFeatures;
public class JavaClientCodegen extends AbstractJavaCodegen implements BeanValidationFeatures { public class JavaClientCodegen extends AbstractJavaCodegen
implements BeanValidationFeatures, PerformBeanValidationFeatures {
static final String MEDIA_TYPE = "mediaType"; static final String MEDIA_TYPE = "mediaType";
@SuppressWarnings("hiding") @SuppressWarnings("hiding")
@@ -28,6 +39,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen implements BeanValida
protected boolean useRxJava = false; protected boolean useRxJava = false;
protected boolean parcelableModel = false; protected boolean parcelableModel = false;
protected boolean useBeanValidation = false; protected boolean useBeanValidation = false;
protected boolean performBeanValidation = false;
public JavaClientCodegen() { public JavaClientCodegen() {
super(); super();
@@ -42,6 +54,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen implements BeanValida
cliOptions.add(CliOption.newBoolean(PARCELABLE_MODEL, "Whether to generate models for Android that implement Parcelable with the okhttp-gson library.")); cliOptions.add(CliOption.newBoolean(PARCELABLE_MODEL, "Whether to generate models for Android that implement Parcelable with the okhttp-gson library."));
cliOptions.add(CliOption.newBoolean(SUPPORT_JAVA6, "Whether to support Java6 with the Jersey1 library.")); cliOptions.add(CliOption.newBoolean(SUPPORT_JAVA6, "Whether to support Java6 with the Jersey1 library."));
cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations"));
cliOptions.add(CliOption.newBoolean(PERFORM_BEANVALIDATION, "Perform BeanValidation"));
supportedLibraries.put("jersey1", "HTTP client: Jersey client 1.19.1. JSON processing: Jackson 2.7.0. Enable Java6 support using '-DsupportJava6=true'."); supportedLibraries.put("jersey1", "HTTP client: Jersey client 1.19.1. JSON processing: Jackson 2.7.0. Enable Java6 support using '-DsupportJava6=true'.");
supportedLibraries.put("feign", "HTTP client: Netflix Feign 8.16.0. JSON processing: Jackson 2.7.0"); supportedLibraries.put("feign", "HTTP client: Netflix Feign 8.16.0. JSON processing: Jackson 2.7.0");
@@ -88,11 +101,11 @@ public class JavaClientCodegen extends AbstractJavaCodegen implements BeanValida
additionalProperties.put(PARCELABLE_MODEL, parcelableModel); additionalProperties.put(PARCELABLE_MODEL, parcelableModel);
if (additionalProperties.containsKey(USE_BEANVALIDATION)) { if (additionalProperties.containsKey(USE_BEANVALIDATION)) {
boolean useBeanValidationProp = Boolean.valueOf(additionalProperties.get(USE_BEANVALIDATION).toString()); this.setUseBeanValidation(convertPropertyToBooleanAndWriteBack(USE_BEANVALIDATION));
this.setUseBeanValidation(useBeanValidationProp); }
// write back as boolean if (additionalProperties.containsKey(PERFORM_BEANVALIDATION)) {
additionalProperties.put(USE_BEANVALIDATION, useBeanValidationProp); this.setPerformBeanValidation(convertPropertyToBooleanAndWriteBack(PERFORM_BEANVALIDATION));
} }
final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/"); final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/");
@@ -122,6 +135,11 @@ public class JavaClientCodegen extends AbstractJavaCodegen implements BeanValida
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
if (performBeanValidation) {
supportingFiles.add(new SupportingFile("BeanValidationException.mustache", invokerFolder,
"BeanValidationException.java"));
}
//TODO: add doc to retrofit1 and feign //TODO: add doc to retrofit1 and feign
if ( "feign".equals(getLibrary()) || "retrofit".equals(getLibrary()) ){ if ( "feign".equals(getLibrary()) || "retrofit".equals(getLibrary()) ){
modelDocTemplateFiles.remove("model_doc.mustache"); modelDocTemplateFiles.remove("model_doc.mustache");
@@ -302,6 +320,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen implements BeanValida
this.useBeanValidation = useBeanValidation; this.useBeanValidation = useBeanValidation;
} }
public void setPerformBeanValidation(boolean performBeanValidation) {
this.performBeanValidation = performBeanValidation;
}
final private static Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)application\\/json(;.*)?"); final private static Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)application\\/json(;.*)?");
final private static Pattern JSON_VENDOR_MIME_PATTERN = Pattern.compile("(?i)application\\/vnd.(.*)+json(;.*)?"); final private static Pattern JSON_VENDOR_MIME_PATTERN = Pattern.compile("(?i)application\\/vnd.(.*)+json(;.*)?");

View File

@@ -0,0 +1,10 @@
package io.swagger.codegen.languages.features;
public interface PerformBeanValidationFeatures {
// Language supports performing BeanValidation
public static final String PERFORM_BEANVALIDATION = "performBeanValidation";
public void setPerformBeanValidation(boolean performBeanValidation);
}

View File

@@ -0,0 +1,27 @@
package {{invokerPackage}};
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.ValidationException;
public class BeanValidationException extends ValidationException {
/**
*
*/
private static final long serialVersionUID = -5294733947409491364L;
Set<ConstraintViolation<Object>> violations;
public BeanValidationException(Set<ConstraintViolation<Object>> violations) {
this.violations = violations;
}
public Set<ConstraintViolation<Object>> getViolations() {
return violations;
}
public void setViolations(Set<ConstraintViolation<Object>> violations) {
this.violations = violations;
}
}

View File

@@ -1,43 +1,45 @@
{{>licenseInfo}} {{>licenseInfo}}
package {{package}}; package {{package}};
import {{invokerPackage}}.ApiException; import {{invokerPackage}}.ApiException;
{{#imports}}import {{import}}; {{#imports}}import {{import}};
{{/imports}} {{/imports}}
import org.junit.Test; import org.junit.Test;
import org.junit.Ignore;
{{^fullJavaUtil}}
import java.util.ArrayList; {{^fullJavaUtil}}
import java.util.HashMap; import java.util.ArrayList;
import java.util.List; import java.util.HashMap;
import java.util.Map; import java.util.List;
{{/fullJavaUtil}} import java.util.Map;
{{/fullJavaUtil}}
/**
* API tests for {{classname}} /**
*/ * API tests for {{classname}}
public class {{classname}}Test { */
@Ignore
private final {{classname}} api = new {{classname}}(); public class {{classname}}Test {
{{#operations}}{{#operation}} private final {{classname}} api = new {{classname}}();
/**
* {{summary}} {{#operations}}{{#operation}}
* /**
* {{notes}} * {{summary}}
* *
* @throws ApiException * {{notes}}
* if the Api call fails *
*/ * @throws ApiException
@Test * if the Api call fails
public void {{operationId}}Test() throws ApiException { */
{{#allParams}} @Test
{{{dataType}}} {{paramName}} = null; public void {{operationId}}Test() throws ApiException {
{{/allParams}} {{#allParams}}
// {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{{dataType}}} {{paramName}} = null;
{{/allParams}}
// TODO: test validations {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
}
{{/operation}}{{/operations}} // TODO: test validations
} }
{{/operation}}{{/operations}}
}

View File

@@ -0,0 +1 @@
{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}}/* @Min({{minimum}}) */{{/minimum}}{{#maximum}}/* @Max({{maximum}}) */{{/maximum}}

View File

@@ -1,165 +1,221 @@
{{>licenseInfo}} {{>licenseInfo}}
package {{package}}; package {{package}};
import {{invokerPackage}}.ApiCallback; import {{invokerPackage}}.ApiCallback;
import {{invokerPackage}}.ApiClient; import {{invokerPackage}}.ApiClient;
import {{invokerPackage}}.ApiException; import {{invokerPackage}}.ApiException;
import {{invokerPackage}}.ApiResponse; import {{invokerPackage}}.ApiResponse;
import {{invokerPackage}}.Configuration; import {{invokerPackage}}.Configuration;
import {{invokerPackage}}.Pair; import {{invokerPackage}}.Pair;
import {{invokerPackage}}.ProgressRequestBody; import {{invokerPackage}}.ProgressRequestBody;
import {{invokerPackage}}.ProgressResponseBody; import {{invokerPackage}}.ProgressResponseBody;
{{#performBeanValidation}}
import com.google.gson.reflect.TypeToken; import {{invokerPackage}}.BeanValidationException;
{{/performBeanValidation}}
import java.io.IOException;
import com.google.gson.reflect.TypeToken;
{{#imports}}import {{import}};
{{/imports}} import java.io.IOException;
import java.lang.reflect.Type; {{#useBeanValidation}}
{{^fullJavaUtil}} import javax.validation.constraints.*;
import java.util.ArrayList; {{/useBeanValidation}}
import java.util.HashMap; {{#performBeanValidation}}
import java.util.List; import javax.validation.ConstraintViolation;
import java.util.Map; import javax.validation.Validation;
{{/fullJavaUtil}} import javax.validation.ValidatorFactory;
import javax.validation.executable.ExecutableValidator;
{{#operations}} import java.util.Set;
public class {{classname}} { import java.lang.reflect.Method;
private ApiClient {{localVariablePrefix}}apiClient; import java.lang.reflect.Type;
{{/performBeanValidation}}
public {{classname}}() {
this(Configuration.getDefaultApiClient()); {{#imports}}import {{import}};
} {{/imports}}
public {{classname}}(ApiClient apiClient) { import java.lang.reflect.Type;
this.{{localVariablePrefix}}apiClient = apiClient; {{^fullJavaUtil}}
} import java.util.ArrayList;
import java.util.HashMap;
public ApiClient getApiClient() { import java.util.List;
return {{localVariablePrefix}}apiClient; import java.util.Map;
} {{/fullJavaUtil}}
public void setApiClient(ApiClient apiClient) { {{#operations}}
this.{{localVariablePrefix}}apiClient = apiClient; public class {{classname}} {
} private ApiClient {{localVariablePrefix}}apiClient;
{{#operation}} public {{classname}}() {
/* Build call for {{operationId}} */ this(Configuration.getDefaultApiClient());
private com.squareup.okhttp.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { }
Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
{{#allParams}}{{#required}} public {{classname}}(ApiClient apiClient) {
// verify the required parameter '{{paramName}}' is set this.{{localVariablePrefix}}apiClient = apiClient;
if ({{paramName}} == null) { }
throw new ApiException("Missing the required parameter '{{paramName}}' when calling {{operationId}}(Async)");
} public ApiClient getApiClient() {
{{/required}}{{/allParams}} return {{localVariablePrefix}}apiClient;
}
// create path and map variables
String {{localVariablePrefix}}localVarPath = "{{{path}}}".replaceAll("\\{format\\}","json"){{#pathParams}} public void setApiClient(ApiClient apiClient) {
.replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; this.{{localVariablePrefix}}apiClient = apiClient;
}
{{javaUtilPrefix}}List<Pair> {{localVariablePrefix}}localVarQueryParams = new {{javaUtilPrefix}}ArrayList<Pair>();{{#queryParams}}
if ({{paramName}} != null) {{#operation}}
{{localVariablePrefix}}localVarQueryParams.addAll({{localVariablePrefix}}apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));{{/queryParams}} /* Build call for {{operationId}} */
private com.squareup.okhttp.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
{{javaUtilPrefix}}Map<String, String> {{localVariablePrefix}}localVarHeaderParams = new {{javaUtilPrefix}}HashMap<String, String>();{{#headerParams}} Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
if ({{paramName}} != null)
{{localVariablePrefix}}localVarHeaderParams.put("{{baseName}}", {{localVariablePrefix}}apiClient.parameterToString({{paramName}}));{{/headerParams}} // create path and map variables
String {{localVariablePrefix}}localVarPath = "{{{path}}}".replaceAll("\\{format\\}","json"){{#pathParams}}
{{javaUtilPrefix}}Map<String, Object> {{localVariablePrefix}}localVarFormParams = new {{javaUtilPrefix}}HashMap<String, Object>();{{#formParams}} .replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}};
if ({{paramName}} != null)
{{localVariablePrefix}}localVarFormParams.put("{{baseName}}", {{paramName}});{{/formParams}} {{javaUtilPrefix}}List<Pair> {{localVariablePrefix}}localVarQueryParams = new {{javaUtilPrefix}}ArrayList<Pair>();{{#queryParams}}
if ({{paramName}} != null)
final String[] {{localVariablePrefix}}localVarAccepts = { {{localVariablePrefix}}localVarQueryParams.addAll({{localVariablePrefix}}apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));{{/queryParams}}
{{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
}; {{javaUtilPrefix}}Map<String, String> {{localVariablePrefix}}localVarHeaderParams = new {{javaUtilPrefix}}HashMap<String, String>();{{#headerParams}}
final String {{localVariablePrefix}}localVarAccept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}localVarAccepts); if ({{paramName}} != null)
if ({{localVariablePrefix}}localVarAccept != null) {{localVariablePrefix}}localVarHeaderParams.put("Accept", {{localVariablePrefix}}localVarAccept); {{localVariablePrefix}}localVarHeaderParams.put("{{baseName}}", {{localVariablePrefix}}apiClient.parameterToString({{paramName}}));{{/headerParams}}
final String[] {{localVariablePrefix}}localVarContentTypes = { {{javaUtilPrefix}}Map<String, Object> {{localVariablePrefix}}localVarFormParams = new {{javaUtilPrefix}}HashMap<String, Object>();{{#formParams}}
{{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} if ({{paramName}} != null)
}; {{localVariablePrefix}}localVarFormParams.put("{{baseName}}", {{paramName}});{{/formParams}}
final String {{localVariablePrefix}}localVarContentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}localVarContentTypes);
{{localVariablePrefix}}localVarHeaderParams.put("Content-Type", {{localVariablePrefix}}localVarContentType); final String[] {{localVariablePrefix}}localVarAccepts = {
{{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
if(progressListener != null) { };
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { final String {{localVariablePrefix}}localVarAccept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}localVarAccepts);
@Override if ({{localVariablePrefix}}localVarAccept != null) {{localVariablePrefix}}localVarHeaderParams.put("Accept", {{localVariablePrefix}}localVarAccept);
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); final String[] {{localVariablePrefix}}localVarContentTypes = {
return originalResponse.newBuilder() {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
.body(new ProgressResponseBody(originalResponse.body(), progressListener)) };
.build(); final String {{localVariablePrefix}}localVarContentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}localVarContentTypes);
} {{localVariablePrefix}}localVarHeaderParams.put("Content-Type", {{localVariablePrefix}}localVarContentType);
});
} if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
String[] {{localVariablePrefix}}localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} }; @Override
return {{localVariablePrefix}}apiClient.buildCall({{localVariablePrefix}}localVarPath, "{{httpMethod}}", {{localVariablePrefix}}localVarQueryParams, {{localVariablePrefix}}localVarPostBody, {{localVariablePrefix}}localVarHeaderParams, {{localVariablePrefix}}localVarFormParams, {{localVariablePrefix}}localVarAuthNames, progressRequestListener); public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
} com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
/** .body(new ProgressResponseBody(originalResponse.body(), progressListener))
* {{summary}} .build();
* {{notes}}{{#allParams}} }
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}{{#returnType}} });
* @return {{returnType}}{{/returnType}} }
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/ String[] {{localVariablePrefix}}localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { return {{localVariablePrefix}}apiClient.buildCall({{localVariablePrefix}}localVarPath, "{{httpMethod}}", {{localVariablePrefix}}localVarQueryParams, {{localVariablePrefix}}localVarPostBody, {{localVariablePrefix}}localVarHeaderParams, {{localVariablePrefix}}localVarFormParams, {{localVariablePrefix}}localVarAuthNames, progressRequestListener);
{{#returnType}}ApiResponse<{{{returnType}}}> {{localVariablePrefix}}resp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} }
return {{localVariablePrefix}}resp.getData();{{/returnType}}
} @SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call {{operationId}}ValidateBeforeCall({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
/** {{^performBeanValidation}}
* {{summary}} {{#allParams}}{{#required}}
* {{notes}}{{#allParams}} // verify the required parameter '{{paramName}}' is set
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} if ({{paramName}} == null) {
* @return ApiResponse&lt;{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}&gt; throw new ApiException("Missing the required parameter '{{paramName}}' when calling {{operationId}}(Async)");
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body }
*/ {{/required}}{{/allParams}}
public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
com.squareup.okhttp.Call {{localVariablePrefix}}call = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}null, null); com.squareup.okhttp.Call {{localVariablePrefix}}call = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}progressListener, progressRequestListener);
{{#returnType}}Type {{localVariablePrefix}}localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); return {{localVariablePrefix}}call;
return {{localVariablePrefix}}apiClient.execute({{localVariablePrefix}}call, {{localVariablePrefix}}localVarReturnType);{{/returnType}}{{^returnType}}return {{localVariablePrefix}}apiClient.execute({{localVariablePrefix}}call);{{/returnType}}
} {{/performBeanValidation}}
{{#performBeanValidation}}
/** try {
* {{summary}} (asynchronously) ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
* {{notes}}{{#allParams}} ExecutableValidator executableValidator = factory.getValidator().forExecutables();
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}
* @param callback The callback to be executed when the API call finishes Object[] parameterValues = { {{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}} };
* @return The request call Method method = this.getClass().getMethod("{{operationId}}WithHttpInfo"{{#allParams}}, {{#isListContainer}}java.util.List{{/isListContainer}}{{#isMapContainer}}java.util.Map{{/isMapContainer}}{{^isListContainer}}{{^isMapContainer}}{{{dataType}}}{{/isMapContainer}}{{/isListContainer}}.class{{/allParams}});
* @throws ApiException If fail to process the API call, e.g. serializing the request body object Set<ConstraintViolation<{{classname}}>> violations = executableValidator.validateParameters(this, method,
*/ parameterValues);
public com.squareup.okhttp.Call {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{localVariablePrefix}}callback) throws ApiException {
if (violations.size() == 0) {
ProgressResponseBody.ProgressListener progressListener = null; com.squareup.okhttp.Call {{localVariablePrefix}}call = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}progressListener, progressRequestListener);
ProgressRequestBody.ProgressRequestListener progressRequestListener = null; return {{localVariablePrefix}}call;
if (callback != null) { } else {
progressListener = new ProgressResponseBody.ProgressListener() { throw new BeanValidationException((Set) violations);
@Override }
public void update(long bytesRead, long contentLength, boolean done) { } catch (NoSuchMethodException e) {
callback.onDownloadProgress(bytesRead, contentLength, done); e.printStackTrace();
} throw new ApiException(e.getMessage());
}; } catch (SecurityException e) {
e.printStackTrace();
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { throw new ApiException(e.getMessage());
@Override }
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done); {{/performBeanValidation}}
}
};
}
com.squareup.okhttp.Call {{localVariablePrefix}}call = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}progressListener, progressRequestListener); }
{{#returnType}}Type {{localVariablePrefix}}localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType();
{{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}localVarReturnType, {{localVariablePrefix}}callback);{{/returnType}}{{^returnType}}{{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}callback);{{/returnType}} /**
return {{localVariablePrefix}}call; * {{summary}}
} * {{notes}}{{#allParams}}
{{/operation}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}{{#returnType}}
} * @return {{returnType}}{{/returnType}}
{{/operations}} * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
{{#returnType}}ApiResponse<{{{returnType}}}> {{localVariablePrefix}}resp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
return {{localVariablePrefix}}resp.getData();{{/returnType}}
}
/**
* {{summary}}
* {{notes}}{{#allParams}}
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}
* @return ApiResponse&lt;{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
com.squareup.okhttp.Call {{localVariablePrefix}}call = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null, null);
{{#returnType}}Type {{localVariablePrefix}}localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType();
return {{localVariablePrefix}}apiClient.execute({{localVariablePrefix}}call, {{localVariablePrefix}}localVarReturnType);{{/returnType}}{{^returnType}}return {{localVariablePrefix}}apiClient.execute({{localVariablePrefix}}call);{{/returnType}}
}
/**
* {{summary}} (asynchronously)
* {{notes}}{{#allParams}}
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{localVariablePrefix}}callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call {{localVariablePrefix}}call = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}progressListener, progressRequestListener);
{{#returnType}}Type {{localVariablePrefix}}localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType();
{{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}localVarReturnType, {{localVariablePrefix}}callback);{{/returnType}}{{^returnType}}{{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}callback);{{/returnType}}
return {{localVariablePrefix}}call;
}
{{/operation}}
}
{{/operations}}

View File

@@ -139,8 +139,21 @@
<version>1.1.0.Final</version> <version>1.1.0.Final</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
{{/useBeanValidation}} {{/useBeanValidation}}
{{#performBeanValidation}}
<!-- Bean Validation Impl. used to perform BeanValidation -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.2.2.Final</version>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>2.2</version>
</dependency>
{{/performBeanValidation}}
<!-- test dependencies --> <!-- test dependencies -->
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>

View File

@@ -3,7 +3,7 @@ package io.swagger.codegen.java;
import io.swagger.codegen.AbstractOptionsTest; import io.swagger.codegen.AbstractOptionsTest;
import io.swagger.codegen.CodegenConfig; import io.swagger.codegen.CodegenConfig;
import io.swagger.codegen.options.JavaClientOptionsProvider; import io.swagger.codegen.options.JavaClientOptionsProvider;
import io.swagger.codegen.options.JavaOptionsProvider; import io.swagger.codegen.options.JavaClientOptionsProvider;
import io.swagger.codegen.languages.JavaClientCodegen; import io.swagger.codegen.languages.JavaClientCodegen;
import io.swagger.codegen.options.OptionsProvider; import io.swagger.codegen.options.OptionsProvider;
@@ -32,34 +32,36 @@ public class JavaClientOptionsTest extends AbstractOptionsTest {
@Override @Override
protected void setExpectations() { protected void setExpectations() {
new Expectations(clientCodegen) {{ new Expectations(clientCodegen) {{
clientCodegen.setModelPackage(JavaOptionsProvider.MODEL_PACKAGE_VALUE); clientCodegen.setModelPackage(JavaClientOptionsProvider.MODEL_PACKAGE_VALUE);
times = 1; times = 1;
clientCodegen.setApiPackage(JavaOptionsProvider.API_PACKAGE_VALUE); clientCodegen.setApiPackage(JavaClientOptionsProvider.API_PACKAGE_VALUE);
times = 1; times = 1;
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(JavaOptionsProvider.SORT_PARAMS_VALUE)); clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(JavaClientOptionsProvider.SORT_PARAMS_VALUE));
times = 1; times = 1;
clientCodegen.setInvokerPackage(JavaOptionsProvider.INVOKER_PACKAGE_VALUE); clientCodegen.setInvokerPackage(JavaClientOptionsProvider.INVOKER_PACKAGE_VALUE);
times = 1; times = 1;
clientCodegen.setGroupId(JavaOptionsProvider.GROUP_ID_VALUE); clientCodegen.setGroupId(JavaClientOptionsProvider.GROUP_ID_VALUE);
times = 1; times = 1;
clientCodegen.setArtifactId(JavaOptionsProvider.ARTIFACT_ID_VALUE); clientCodegen.setArtifactId(JavaClientOptionsProvider.ARTIFACT_ID_VALUE);
times = 1; times = 1;
clientCodegen.setArtifactVersion(JavaOptionsProvider.ARTIFACT_VERSION_VALUE); clientCodegen.setArtifactVersion(JavaClientOptionsProvider.ARTIFACT_VERSION_VALUE);
times = 1; times = 1;
clientCodegen.setSourceFolder(JavaOptionsProvider.SOURCE_FOLDER_VALUE); clientCodegen.setSourceFolder(JavaClientOptionsProvider.SOURCE_FOLDER_VALUE);
times = 1; times = 1;
clientCodegen.setLocalVariablePrefix(JavaOptionsProvider.LOCAL_PREFIX_VALUE); clientCodegen.setLocalVariablePrefix(JavaClientOptionsProvider.LOCAL_PREFIX_VALUE);
times = 1; times = 1;
clientCodegen.setSerializableModel(Boolean.valueOf(JavaOptionsProvider.SERIALIZABLE_MODEL_VALUE)); clientCodegen.setSerializableModel(Boolean.valueOf(JavaClientOptionsProvider.SERIALIZABLE_MODEL_VALUE));
times = 1; times = 1;
clientCodegen.setLibrary(JavaClientOptionsProvider.DEFAULT_LIBRARY_VALUE); clientCodegen.setLibrary(JavaClientOptionsProvider.DEFAULT_LIBRARY_VALUE);
times = 1; times = 1;
clientCodegen.setFullJavaUtil(Boolean.valueOf(JavaOptionsProvider.FULL_JAVA_UTIL_VALUE)); clientCodegen.setFullJavaUtil(Boolean.valueOf(JavaClientOptionsProvider.FULL_JAVA_UTIL_VALUE));
times = 1; times = 1;
//clientCodegen.setSupportJava6(Boolean.valueOf(JavaOptionsProvider.SUPPORT_JAVA6)); // clientCodegen.setSupportJava6(Boolean.valueOf(JavaClientOptionsProvider.SUPPORT_JAVA6));
//times = 1; //times = 1;
clientCodegen.setUseBeanValidation(Boolean.valueOf(JavaOptionsProvider.USE_BEANVALIDATION)); clientCodegen.setUseBeanValidation(Boolean.valueOf(JavaClientOptionsProvider.USE_BEANVALIDATION));
times = 1; times = 1;
clientCodegen.setUseBeanValidation(Boolean.valueOf(JavaClientOptionsProvider.PERFORM_BEANVALIDATION));
times = 1;
}}; }};
} }
} }

View File

@@ -9,6 +9,8 @@ import java.util.Map;
public class JavaClientOptionsProvider extends JavaOptionsProvider { public class JavaClientOptionsProvider extends JavaOptionsProvider {
public static final String PERFORM_BEANVALIDATION = "false";
public static final String DEFAULT_LIBRARY_VALUE = "jersey2"; public static final String DEFAULT_LIBRARY_VALUE = "jersey2";
@Override @Override
@@ -19,6 +21,7 @@ public class JavaClientOptionsProvider extends JavaOptionsProvider {
options.put(JavaClientCodegen.PARCELABLE_MODEL, "false"); options.put(JavaClientCodegen.PARCELABLE_MODEL, "false");
options.put(JavaClientCodegen.SUPPORT_JAVA6, "false"); options.put(JavaClientCodegen.SUPPORT_JAVA6, "false");
options.put(JavaClientCodegen.USE_BEANVALIDATION, "false"); options.put(JavaClientCodegen.USE_BEANVALIDATION, "false");
options.put(JavaClientCodegen.PERFORM_BEANVALIDATION, PERFORM_BEANVALIDATION);
return options; return options;
} }

View File

@@ -8,17 +8,17 @@ git_repo_id=$2
release_note=$3 release_note=$3
if [ "$git_user_id" = "" ]; then if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID" git_user_id=""
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi fi
if [ "$git_repo_id" = "" ]; then if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID" git_repo_id=""
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi fi
if [ "$release_note" = "" ]; then if [ "$release_note" = "" ]; then
release_note="Minor update" release_note=""
echo "[INFO] No command line input provided. Set \$release_note to $release_note" echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi fi

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
@@ -16,7 +16,7 @@ package io.swagger.client;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-11-12T23:31:10.007+01:00")
public class ApiException extends Exception { public class ApiException extends Exception {
private int code = 0; private int code = 0;
private Map<String, List<String>> responseHeaders = null; private Map<String, List<String>> responseHeaders = null;

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
@@ -13,7 +13,7 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-11-12T23:31:10.007+01:00")
public class Configuration { public class Configuration {
private static ApiClient defaultApiClient = new ApiClient(); private static ApiClient defaultApiClient = new ApiClient();

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
@@ -13,7 +13,7 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-11-12T23:31:10.007+01:00")
public class Pair { public class Pair {
private String name = ""; private String name = "";
private String value = ""; private String value = "";

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
@@ -13,7 +13,7 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-11-12T23:31:10.007+01:00")
public class StringUtil { public class StringUtil {
/** /**
* Check if the given array contains the given value (with case-insensitive comparison). * Check if the given array contains the given value (with case-insensitive comparison).

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
@@ -59,12 +59,6 @@ public class PetApi {
private com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body; 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 // create path and map variables
String localVarPath = "/pet".replaceAll("\\{format\\}","json"); String localVarPath = "/pet".replaceAll("\\{format\\}","json");
@@ -100,6 +94,23 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" }; String[] localVarAuthNames = new String[] { "petstore_auth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -120,7 +131,7 @@ public class PetApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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); return apiClient.execute(call);
} }
@@ -153,7 +164,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); apiClient.executeAsync(call, callback);
return call; return call;
} }
@@ -161,12 +172,6 @@ public class PetApi {
private com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null; 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 // create path and map variables
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
@@ -205,6 +210,23 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" }; String[] localVarAuthNames = new String[] { "petstore_auth" };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -227,7 +249,7 @@ public class PetApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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); return apiClient.execute(call);
} }
@@ -261,7 +283,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); apiClient.executeAsync(call, callback);
return call; return call;
} }
@@ -269,12 +291,6 @@ public class PetApi {
private com.squareup.okhttp.Call findPetsByStatusCall(List<String> status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call findPetsByStatusCall(List<String> status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null; 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 // create path and map variables
String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json"); String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json");
@@ -312,6 +328,23 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" }; String[] localVarAuthNames = new String[] { "petstore_auth" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -334,7 +367,7 @@ public class PetApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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(); Type localVarReturnType = new TypeToken<List<Pet>>(){}.getType();
return apiClient.execute(call, localVarReturnType); return apiClient.execute(call, localVarReturnType);
} }
@@ -368,7 +401,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(); Type localVarReturnType = new TypeToken<List<Pet>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback); apiClient.executeAsync(call, localVarReturnType, callback);
return call; return call;
@@ -377,12 +410,6 @@ public class PetApi {
private com.squareup.okhttp.Call findPetsByTagsCall(List<String> tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call findPetsByTagsCall(List<String> tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null; 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 // create path and map variables
String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json"); String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json");
@@ -420,6 +447,23 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" }; String[] localVarAuthNames = new String[] { "petstore_auth" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -442,7 +486,7 @@ public class PetApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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(); Type localVarReturnType = new TypeToken<List<Pet>>(){}.getType();
return apiClient.execute(call, localVarReturnType); return apiClient.execute(call, localVarReturnType);
} }
@@ -476,7 +520,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(); Type localVarReturnType = new TypeToken<List<Pet>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback); apiClient.executeAsync(call, localVarReturnType, callback);
return call; return call;
@@ -485,12 +529,6 @@ public class PetApi {
private com.squareup.okhttp.Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null; 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 // create path and map variables
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
@@ -527,6 +565,23 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "api_key" }; String[] localVarAuthNames = new String[] { "api_key" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -549,7 +604,7 @@ public class PetApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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(); Type localVarReturnType = new TypeToken<Pet>(){}.getType();
return apiClient.execute(call, localVarReturnType); return apiClient.execute(call, localVarReturnType);
} }
@@ -583,7 +638,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(); Type localVarReturnType = new TypeToken<Pet>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback); apiClient.executeAsync(call, localVarReturnType, callback);
return call; return call;
@@ -592,12 +647,6 @@ public class PetApi {
private com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body; 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 // create path and map variables
String localVarPath = "/pet".replaceAll("\\{format\\}","json"); String localVarPath = "/pet".replaceAll("\\{format\\}","json");
@@ -633,6 +682,23 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" }; String[] localVarAuthNames = new String[] { "petstore_auth" };
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -653,7 +719,7 @@ public class PetApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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); return apiClient.execute(call);
} }
@@ -686,7 +752,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); apiClient.executeAsync(call, callback);
return call; return call;
} }
@@ -694,12 +760,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 { 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; 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 // create path and map variables
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json") String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
@@ -740,6 +800,23 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" }; String[] localVarAuthNames = new String[] { "petstore_auth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -764,7 +841,7 @@ public class PetApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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); return apiClient.execute(call);
} }
@@ -799,7 +876,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); apiClient.executeAsync(call, callback);
return call; return call;
} }
@@ -807,12 +884,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 { 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; 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 // create path and map variables
String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json") String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
@@ -853,6 +924,23 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" }; String[] localVarAuthNames = new String[] { "petstore_auth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -879,7 +967,7 @@ public class PetApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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(); Type localVarReturnType = new TypeToken<ModelApiResponse>(){}.getType();
return apiClient.execute(call, localVarReturnType); return apiClient.execute(call, localVarReturnType);
} }
@@ -915,7 +1003,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(); Type localVarReturnType = new TypeToken<ModelApiResponse>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback); apiClient.executeAsync(call, localVarReturnType, callback);
return call; return call;

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
@@ -26,6 +26,7 @@ import com.google.gson.reflect.TypeToken;
import java.io.IOException; import java.io.IOException;
import io.swagger.client.model.Order; import io.swagger.client.model.Order;
import java.lang.reflect.Type; import java.lang.reflect.Type;
@@ -57,12 +58,6 @@ public class StoreApi {
private com.squareup.okhttp.Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null; 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 // create path and map variables
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
@@ -99,6 +94,23 @@ public class StoreApi {
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -119,7 +131,7 @@ public class StoreApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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); return apiClient.execute(call);
} }
@@ -152,7 +164,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); apiClient.executeAsync(call, callback);
return call; return call;
} }
@@ -160,7 +172,6 @@ public class StoreApi {
private com.squareup.okhttp.Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null; Object localVarPostBody = null;
// create path and map variables // create path and map variables
String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json"); String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json");
@@ -196,6 +207,18 @@ public class StoreApi {
String[] localVarAuthNames = new String[] { "api_key" }; String[] localVarAuthNames = new String[] { "api_key" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -216,7 +239,7 @@ public class StoreApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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(); Type localVarReturnType = new TypeToken<Map<String, Integer>>(){}.getType();
return apiClient.execute(call, localVarReturnType); return apiClient.execute(call, localVarReturnType);
} }
@@ -249,7 +272,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(); Type localVarReturnType = new TypeToken<Map<String, Integer>>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback); apiClient.executeAsync(call, localVarReturnType, callback);
return call; return call;
@@ -258,12 +281,6 @@ public class StoreApi {
private com.squareup.okhttp.Call getOrderByIdCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call getOrderByIdCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null; 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 // create path and map variables
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json") String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
@@ -300,6 +317,23 @@ public class StoreApi {
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -322,7 +356,7 @@ public class StoreApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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(); Type localVarReturnType = new TypeToken<Order>(){}.getType();
return apiClient.execute(call, localVarReturnType); return apiClient.execute(call, localVarReturnType);
} }
@@ -356,7 +390,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(); Type localVarReturnType = new TypeToken<Order>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback); apiClient.executeAsync(call, localVarReturnType, callback);
return call; return call;
@@ -365,12 +399,6 @@ public class StoreApi {
private com.squareup.okhttp.Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body; 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 // create path and map variables
String localVarPath = "/store/order".replaceAll("\\{format\\}","json"); String localVarPath = "/store/order".replaceAll("\\{format\\}","json");
@@ -406,6 +434,23 @@ public class StoreApi {
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -428,7 +473,7 @@ public class StoreApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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(); Type localVarReturnType = new TypeToken<Order>(){}.getType();
return apiClient.execute(call, localVarReturnType); return apiClient.execute(call, localVarReturnType);
} }
@@ -462,7 +507,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(); Type localVarReturnType = new TypeToken<Order>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback); apiClient.executeAsync(call, localVarReturnType, callback);
return call; return call;

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
@@ -26,6 +26,7 @@ import com.google.gson.reflect.TypeToken;
import java.io.IOException; import java.io.IOException;
import io.swagger.client.model.User; import io.swagger.client.model.User;
import java.lang.reflect.Type; import java.lang.reflect.Type;
@@ -57,12 +58,6 @@ public class UserApi {
private com.squareup.okhttp.Call createUserCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call createUserCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body; 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 // create path and map variables
String localVarPath = "/user".replaceAll("\\{format\\}","json"); String localVarPath = "/user".replaceAll("\\{format\\}","json");
@@ -98,6 +93,23 @@ public class UserApi {
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -118,7 +130,7 @@ public class UserApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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); return apiClient.execute(call);
} }
@@ -151,7 +163,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); apiClient.executeAsync(call, callback);
return call; return call;
} }
@@ -159,12 +171,6 @@ public class UserApi {
private com.squareup.okhttp.Call createUsersWithArrayInputCall(List<User> body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call createUsersWithArrayInputCall(List<User> body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body; 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 // create path and map variables
String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json"); String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json");
@@ -200,6 +206,23 @@ public class UserApi {
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -220,7 +243,7 @@ public class UserApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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); return apiClient.execute(call);
} }
@@ -253,7 +276,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); apiClient.executeAsync(call, callback);
return call; return call;
} }
@@ -261,12 +284,6 @@ public class UserApi {
private com.squareup.okhttp.Call createUsersWithListInputCall(List<User> body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call createUsersWithListInputCall(List<User> body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body; 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 // create path and map variables
String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json"); String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json");
@@ -302,6 +319,23 @@ public class UserApi {
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -322,7 +356,7 @@ public class UserApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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); return apiClient.execute(call);
} }
@@ -355,7 +389,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); apiClient.executeAsync(call, callback);
return call; return call;
} }
@@ -363,12 +397,6 @@ public class UserApi {
private com.squareup.okhttp.Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null; 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 // create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
@@ -405,6 +433,23 @@ public class UserApi {
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -425,7 +470,7 @@ public class UserApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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); return apiClient.execute(call);
} }
@@ -458,7 +503,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); apiClient.executeAsync(call, callback);
return call; return call;
} }
@@ -466,12 +511,6 @@ public class UserApi {
private com.squareup.okhttp.Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null; 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 // create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
@@ -508,6 +547,23 @@ public class UserApi {
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -530,7 +586,7 @@ public class UserApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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(); Type localVarReturnType = new TypeToken<User>(){}.getType();
return apiClient.execute(call, localVarReturnType); return apiClient.execute(call, localVarReturnType);
} }
@@ -564,7 +620,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(); Type localVarReturnType = new TypeToken<User>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback); apiClient.executeAsync(call, localVarReturnType, callback);
return call; return call;
@@ -573,17 +629,6 @@ public class UserApi {
private com.squareup.okhttp.Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null; 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 // create path and map variables
String localVarPath = "/user/login".replaceAll("\\{format\\}","json"); String localVarPath = "/user/login".replaceAll("\\{format\\}","json");
@@ -623,6 +668,28 @@ public class UserApi {
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -647,7 +714,7 @@ public class UserApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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(); Type localVarReturnType = new TypeToken<String>(){}.getType();
return apiClient.execute(call, localVarReturnType); return apiClient.execute(call, localVarReturnType);
} }
@@ -682,7 +749,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(); Type localVarReturnType = new TypeToken<String>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback); apiClient.executeAsync(call, localVarReturnType, callback);
return call; return call;
@@ -691,7 +758,6 @@ public class UserApi {
private com.squareup.okhttp.Call logoutUserCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call logoutUserCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null; Object localVarPostBody = null;
// create path and map variables // create path and map variables
String localVarPath = "/user/logout".replaceAll("\\{format\\}","json"); String localVarPath = "/user/logout".replaceAll("\\{format\\}","json");
@@ -727,6 +793,18 @@ public class UserApi {
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -745,7 +823,7 @@ public class UserApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/ */
public ApiResponse<Void> logoutUserWithHttpInfo() throws ApiException { 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); return apiClient.execute(call);
} }
@@ -777,7 +855,7 @@ public class UserApi {
}; };
} }
com.squareup.okhttp.Call call = logoutUserCall(progressListener, progressRequestListener); com.squareup.okhttp.Call call = logoutUserValidateBeforeCall(progressListener, progressRequestListener);
apiClient.executeAsync(call, callback); apiClient.executeAsync(call, callback);
return call; return call;
} }
@@ -785,17 +863,6 @@ public class UserApi {
private com.squareup.okhttp.Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body; 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 // create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
@@ -832,6 +899,28 @@ public class UserApi {
String[] localVarAuthNames = new String[] { }; String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
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;
} }
/** /**
@@ -854,7 +943,7 @@ public class UserApi {
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @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 { 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); return apiClient.execute(call);
} }
@@ -888,7 +977,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); apiClient.executeAsync(call, callback);
return call; return call;
} }

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
@@ -18,7 +18,7 @@ import io.swagger.client.Pair;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-11-12T23:31:10.007+01:00")
public class ApiKeyAuth implements Authentication { public class ApiKeyAuth implements Authentication {
private final String location; private final String location;
private final String paramName; private final String paramName;

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
@@ -18,7 +18,7 @@ import io.swagger.client.Pair;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-11-12T23:31:10.007+01:00")
public class OAuth implements Authentication { public class OAuth implements Authentication {
private String accessToken; private String accessToken;

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
@@ -19,9 +19,10 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
/** /**
* Category * A category for a pet
*/ */
@ApiModel(description = "A category for a pet")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-11-12T23:31:10.007+01:00")
public class Category { public class Category {
@SerializedName("id") @SerializedName("id")
private Long id = null; private Long id = null;

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
@@ -19,9 +19,10 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
/** /**
* ModelApiResponse * Describes the result of uploading an image resource
*/ */
@ApiModel(description = "Describes the result of uploading an image resource")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-11-12T23:31:10.007+01:00")
public class ModelApiResponse { public class ModelApiResponse {
@SerializedName("code") @SerializedName("code")
private Integer code = null; private Integer code = null;

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
@@ -20,9 +20,10 @@ import io.swagger.annotations.ApiModelProperty;
import org.joda.time.DateTime; import org.joda.time.DateTime;
/** /**
* Order * An order for a pets from the pet store
*/ */
@ApiModel(description = "An order for a pets from the pet store")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-11-12T23:31:10.007+01:00")
public class Order { public class Order {
@SerializedName("id") @SerializedName("id")
private Long id = null; private Long id = null;

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
@@ -23,9 +23,10 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* Pet * A pet for sale in the pet store
*/ */
@ApiModel(description = "A pet for sale in the pet store")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-11-12T23:31:10.007+01:00")
public class Pet { public class Pet {
@SerializedName("id") @SerializedName("id")
private Long id = null; private Long id = null;

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
@@ -19,9 +19,10 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
/** /**
* Tag * A tag for a pet
*/ */
@ApiModel(description = "A tag for a pet")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-11-12T23:31:10.007+01:00")
public class Tag { public class Tag {
@SerializedName("id") @SerializedName("id")
private Long id = null; private Long id = null;

View File

@@ -1,6 +1,6 @@
/* /*
* Swagger Petstore * 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: \" \\ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
@@ -19,9 +19,10 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
/** /**
* User * A User who is purchasing from the pet store
*/ */
@ApiModel(description = "A User who is purchasing from the pet store")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-11-12T23:31:10.007+01:00")
public class User { public class User {
@SerializedName("id") @SerializedName("id")
private Long id = null; private Long id = null;