diff --git a/bin/configs/java-okhttp-gson-dynamicOperations.yaml b/bin/configs/java-okhttp-gson-dynamicOperations.yaml
new file mode 100644
index 000000000000..751ce2e992c9
--- /dev/null
+++ b/bin/configs/java-okhttp-gson-dynamicOperations.yaml
@@ -0,0 +1,9 @@
+generatorName: java
+outputDir: samples/client/petstore/java/okhttp-gson-dynamicOperations
+library: okhttp-gson
+inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+additionalProperties:
+ artifactId: petstore-okhttp-gson-dynamicoperations
+ hideGenerationTimestamp: "true"
+ dynamicOperations: "true"
diff --git a/docs/generators/java.md b/docs/generators/java.md
index 5d258a98568f..986c96b3238d 100644
--- a/docs/generators/java.md
+++ b/docs/generators/java.md
@@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|Specify the behavior when the 'additionalProperties' keyword is not present in the OAS document. If false: the 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. If true: when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.This setting is currently ignored for OAS 2.0 documents: 1) When the 'additionalProperties' keyword is not present in a 2.0 schema, additional properties are NOT allowed. 2) Boolean values of the 'additionalProperties' keyword are ignored. It's as if additional properties are NOT allowed.Note: the root cause are issues #1369 and #1371, which must be resolved in the swagger-parser project.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is automatically set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.
|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
+|dynamicOperations|Generate operations dynamically at runtime from an OAS| |false|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java
index aab0fa37f64f..a0ce92fac1cd 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java
@@ -62,6 +62,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
public static final String CASE_INSENSITIVE_RESPONSE_HEADERS = "caseInsensitiveResponseHeaders";
public static final String MICROPROFILE_FRAMEWORK = "microprofileFramework";
public static final String USE_ABSTRACTION_FOR_FILES = "useAbstractionForFiles";
+ public static final String DYNAMIC_OPERATIONS = "dynamicOperations";
public static final String PLAY_24 = "play24";
public static final String PLAY_25 = "play25";
@@ -107,6 +108,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
protected boolean useReflectionEqualsHashCode = false;
protected boolean caseInsensitiveResponseHeaders = false;
protected boolean useAbstractionForFiles = false;
+ protected boolean dynamicOperations = false;
protected String authFolder;
protected String serializationLibrary = null;
@@ -150,6 +152,7 @@ public JavaClientCodegen() {
cliOptions.add(CliOption.newBoolean(CASE_INSENSITIVE_RESPONSE_HEADERS, "Make API response's headers case-insensitive. Available on " + OKHTTP_GSON + ", " + JERSEY2 + " libraries"));
cliOptions.add(CliOption.newString(MICROPROFILE_FRAMEWORK, "Framework for microprofile. Possible values \"kumuluzee\""));
cliOptions.add(CliOption.newBoolean(USE_ABSTRACTION_FOR_FILES, "Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on " + RESTTEMPLATE + " library"));
+ cliOptions.add(CliOption.newBoolean(DYNAMIC_OPERATIONS, "Generate operations dynamically at runtime from an OAS", this.dynamicOperations));
supportedLibraries.put(JERSEY1, "HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.");
supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x");
@@ -308,6 +311,11 @@ public void processOpts() {
this.setUseAbstractionForFiles(convertPropertyToBooleanAndWriteBack(USE_ABSTRACTION_FOR_FILES));
}
+ if (additionalProperties.containsKey(DYNAMIC_OPERATIONS)) {
+ this.setDynamicOperations(Boolean.valueOf(additionalProperties.get(DYNAMIC_OPERATIONS).toString()));
+ }
+ additionalProperties.put(DYNAMIC_OPERATIONS, dynamicOperations);
+
final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/");
final String apiFolder = (sourceFolder + '/' + apiPackage).replace(".", "/");
authFolder = (sourceFolder + '/' + invokerPackage + ".auth").replace(".", "/");
@@ -324,7 +332,12 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("ApiClient.mustache", invokerFolder, "ApiClient.java"));
supportingFiles.add(new SupportingFile("ServerConfiguration.mustache", invokerFolder, "ServerConfiguration.java"));
supportingFiles.add(new SupportingFile("ServerVariable.mustache", invokerFolder, "ServerVariable.java"));
- supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml"));
+ if (dynamicOperations) {
+ supportingFiles.add(new SupportingFile("openapi.mustache", projectFolder + "/resources/openapi", "openapi.yaml"));
+ supportingFiles.add(new SupportingFile("apiOperation.mustache", invokerFolder, "ApiOperation.java"));
+ } else {
+ supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml"));
+ }
if (dateLibrary.equals("java8") && (isLibrary(WEBCLIENT) || isLibrary(VERTX) || isLibrary(RESTTEMPLATE) || isLibrary(RESTEASY) || isLibrary(MICROPROFILE) || isLibrary(JERSEY2))) {
supportingFiles.add(new SupportingFile("JavaTimeFormatter.mustache", invokerFolder, "JavaTimeFormatter.java"));
@@ -939,6 +952,10 @@ public void setUseAbstractionForFiles(boolean useAbstractionForFiles) {
this.useAbstractionForFiles = useAbstractionForFiles;
}
+ public void setDynamicOperations(final boolean dynamicOperations) {
+ this.dynamicOperations = dynamicOperations;
+ }
+
/**
* Serialization library.
*
diff --git a/modules/openapi-generator/src/main/resources/Java/apiOperation.mustache b/modules/openapi-generator/src/main/resources/Java/apiOperation.mustache
new file mode 100644
index 000000000000..97adb0ea285f
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/apiOperation.mustache
@@ -0,0 +1,28 @@
+{{>licenseInfo}}
+package {{invokerPackage}};
+
+import io.swagger.v3.oas.models.Operation;
+
+public class ApiOperation {
+ private final String path;
+ private final String method;
+ private final Operation operation;
+
+ public ApiOperation(String path, String method, Operation operation) {
+ this.path = path;
+ this.method = method;
+ this.operation = operation;
+ }
+
+ public Operation getOperation() {
+ return operation;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public String getMethod() {
+ return method;
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache
index 37572c1b4a78..d417072e3344 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache
@@ -2,6 +2,14 @@
package {{invokerPackage}};
+{{#dynamicOperations}}
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.Operation;
+import io.swagger.v3.oas.models.PathItem;
+import io.swagger.v3.oas.models.parameters.Parameter;
+import io.swagger.v3.oas.models.parameters.Parameter.StyleEnum;
+import io.swagger.v3.parser.OpenAPIV3Parser;
+{{/dynamicOperations}}
import okhttp3.*;
import okhttp3.internal.http.HttpMethod;
import okhttp3.internal.tls.OkHostnameVerifier;
@@ -86,6 +94,10 @@ public class ApiClient {
private HttpLoggingInterceptor loggingInterceptor;
+ {{#dynamicOperations}}
+ private Map operationLookupMap = new HashMap<>();
+
+ {{/dynamicOperations}}
/*
* Basic constructor for ApiClient
*/
@@ -209,6 +221,11 @@ public class ApiClient {
setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}");
authentications = new HashMap();
+ {{#dynamicOperations}}
+
+ OpenAPI openAPI = new OpenAPIV3Parser().read("openapi/openapi.yaml");
+ createOperationLookupMap(openAPI);
+ {{/dynamicOperations}}
}
/**
@@ -694,6 +711,7 @@ public class ApiClient {
return params;
}
+ {{^dynamicOperations}}
/**
* Formats the specified collection query parameters to a list of {@code Pair} objects.
*
@@ -743,6 +761,46 @@ public class ApiClient {
return params;
}
+ {{/dynamicOperations}}
+ {{#dynamicOperations}}
+ public List parameterToPairs(Parameter param, Collection value) {
+ List params = new ArrayList();
+
+ // preconditions
+ if (param == null || param.getName() == null || param.getName().isEmpty() || value == null) {
+ return params;
+ }
+
+ // create the params based on the collection format
+ if (StyleEnum.FORM.equals(param.getStyle()) && Boolean.TRUE.equals(param.getExplode())) {
+ for (Object item : value) {
+ params.add(new Pair(param.getName(), escapeString(parameterToString(item))));
+ }
+ return params;
+ }
+
+ // collectionFormat is assumed to be "csv" by default
+ String delimiter = ",";
+
+ // escape all delimiters except commas, which are URI reserved
+ // characters
+ if (StyleEnum.SPACEDELIMITED.equals(param.getStyle())) {
+ delimiter = escapeString(" ");
+ } else if (StyleEnum.PIPEDELIMITED.equals(param.getStyle())) {
+ delimiter = escapeString("|");
+ }
+
+ StringBuilder sb = new StringBuilder();
+ for (Object item : value) {
+ sb.append(delimiter);
+ sb.append(escapeString(parameterToString(item)));
+ }
+
+ params.add(new Pair(param.getName(), sb.substring(delimiter.length())));
+
+ return params;
+ }
+ {{/dynamicOperations}}
/**
* Formats the specified collection path parameter to a string value.
@@ -1467,4 +1525,75 @@ public class ApiClient {
throw new AssertionError(e);
}
}
+ {{#dynamicOperations}}
+
+ public ApiClient createOperationLookupMap(OpenAPI openAPI) {
+ operationLookupMap = new HashMap<>();
+ for (Map.Entry pathItemEntry : openAPI.getPaths().entrySet()) {
+ String path = pathItemEntry.getKey();
+ PathItem pathItem = pathItemEntry.getValue();
+ addOperationLookupEntry(path, "GET", pathItem.getGet());
+ addOperationLookupEntry(path, "PUT", pathItem.getPut());
+ addOperationLookupEntry(path, "POST", pathItem.getPost());
+ addOperationLookupEntry(path, "DELETE", pathItem.getDelete());
+ addOperationLookupEntry(path, "OPTIONS", pathItem.getOptions());
+ addOperationLookupEntry(path, "HEAD", pathItem.getHead());
+ addOperationLookupEntry(path, "PATCH", pathItem.getPatch());
+ addOperationLookupEntry(path, "TRACE", pathItem.getTrace());
+ }
+ return this;
+ }
+
+ private void addOperationLookupEntry(String path, String method, Operation operation) {
+ if ( operation != null && operation.getOperationId() != null) {
+ operationLookupMap.put(
+ operation.getOperationId(),
+ new ApiOperation(path, method, operation));
+ }
+ }
+
+ public Map getOperationLookupMap() {
+ return operationLookupMap;
+ }
+
+ public String fillParametersFromOperation(
+ Operation operation,
+ Map paramMap,
+ String path,
+ List queryParams,
+ List collectionQueryParams,
+ Map headerParams,
+ Map cookieParams
+ ) {
+ for (Map.Entry entry : paramMap.entrySet()) {
+ Object value = entry.getValue();
+ for (Parameter param : operation.getParameters()) {
+ if (entry.getKey().equals(param.getName())) {
+ switch (param.getIn()) {
+ case "path":
+ path = path.replaceAll("\\{" + param.getName() + "\\}", escapeString(value.toString()));
+ break;
+ case "query":
+ if (value instanceof Collection>) {
+ collectionQueryParams.addAll(parameterToPairs(param, (Collection) value));
+ } else {
+ queryParams.addAll(parameterToPair(param.getName(), value));
+ }
+ break;
+ case "header":
+ headerParams.put(param.getName(), parameterToString(value));
+ break;
+ case "cookie":
+ cookieParams.put(param.getName(), parameterToString(value));
+ break;
+ default:
+ throw new IllegalStateException("Unexpected param in: " + param.getIn());
+ }
+
+ }
+ }
+ }
+ return path;
+ }
+ {{/dynamicOperations}}
}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache
index bbbca63b2b17..6f71a36cd979 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache
@@ -5,6 +5,9 @@ package {{package}};
import {{invokerPackage}}.ApiCallback;
import {{invokerPackage}}.ApiClient;
import {{invokerPackage}}.ApiException;
+{{#dynamicOperations}}
+import {{invokerPackage}}.ApiOperation;
+{{/dynamicOperations}}
import {{invokerPackage}}.ApiResponse;
import {{invokerPackage}}.Configuration;
import {{invokerPackage}}.Pair;
@@ -15,6 +18,10 @@ import {{invokerPackage}}.BeanValidationException;
{{/performBeanValidation}}
import com.google.gson.reflect.TypeToken;
+{{#dynamicOperations}}
+import io.swagger.v3.oas.models.Operation;
+import io.swagger.v3.oas.models.parameters.Parameter;
+{{/dynamicOperations}}
import java.io.IOException;
@@ -93,38 +100,63 @@ public class {{classname}} {
Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
// create path and map variables
+ {{^dynamicOperations}}
String localVarPath = "{{{path}}}"{{#pathParams}}
.replaceAll("\\{" + "{{baseName}}" + "\\}", localVarApiClient.escapeString({{#collectionFormat}}localVarApiClient.collectionPathParameterToString("{{{collectionFormat}}}", {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.toString(){{/collectionFormat}})){{/pathParams}};
+ {{/dynamicOperations}}
+ {{#dynamicOperations}}
+ ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("{{{operationId}}}");
+ if (apiOperation == null) {
+ throw new ApiException("Operation not found in OAS");
+ }
+ Operation operation = apiOperation.getOperation();
+ String localVarPath = apiOperation.getPath();
+ Map paramMap = new HashMap<>();
+ {{#allParams}}
+ {{^isFormParam}}
+ {{^isBodyParam}}
+ paramMap.put("{{baseName}}", {{paramName}});
+ {{/isBodyParam}}
+ {{/isFormParam}}
+ {{/allParams}}
+ {{/dynamicOperations}}
{{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList();
{{javaUtilPrefix}}List localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList();
+ {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap();
+ {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap();
+ {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap();
+
+ {{#formParams}}
+ if ({{paramName}} != null) {
+ localVarFormParams.put("{{baseName}}", {{paramName}});
+ }
+
+ {{/formParams}}
+ {{^dynamicOperations}}
{{#queryParams}}
if ({{paramName}} != null) {
{{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}}));
}
{{/queryParams}}
- {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap();
{{#headerParams}}
if ({{paramName}} != null) {
localVarHeaderParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}}));
}
{{/headerParams}}
- {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap();
{{#cookieParams}}
if ({{paramName}} != null) {
localVarCookieParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}}));
}
{{/cookieParams}}
- {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap();
- {{#formParams}}
- if ({{paramName}} != null) {
- localVarFormParams.put("{{baseName}}", {{paramName}});
- }
+ {{/dynamicOperations}}
+ {{#dynamicOperations}}
+ localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams);
- {{/formParams}}
+ {{/dynamicOperations}}
final String[] localVarAccepts = {
{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}
};
@@ -140,7 +172,7 @@ public class {{classname}} {
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} };
- return localVarApiClient.buildCall(localVarPath, "{{httpMethod}}", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ return localVarApiClient.buildCall(localVarPath, {{^dynamicOperations}}"{{httpMethod}}"{{/dynamicOperations}}{{#dynamicOperations}}apiOperation.getMethod(){{/dynamicOperations}}, localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
{{#isDeprecated}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache
index b263167cb55f..8f10fd4e7281 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache
@@ -142,6 +142,9 @@ dependencies {
{{#threetenbp}}
compile 'org.threeten:threetenbp:1.4.3'
{{/threetenbp}}
+ {{#dynamicOperations}}
+ compile 'io.swagger.parser.v3:swagger-parser-v3:2.0.23'
+ {{/dynamicOperations}}
compile 'javax.annotation:javax.annotation-api:1.3.2'
testCompile 'junit:junit:4.13.1'
}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache
index 16c3f694b93a..a14047e79984 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache
@@ -23,6 +23,9 @@ lazy val root = (project in file(".")).
{{#threetenbp}}
"org.threeten" % "threetenbp" % "1.4.3" % "compile",
{{/threetenbp}}
+ {{#dynamicOperations}}
+ "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.23" % "compile"
+ {{/dynamicOperations}}
"io.gsonfire" % "gson-fire" % "1.8.3" % "compile",
"javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
"com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile",
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
index b97d8ccba01a..598312cad6c6 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
@@ -274,6 +274,13 @@
${threetenbp-version}
{{/threetenbp}}
+ {{#dynamicOperations}}
+
+ io.swagger.parser.v3
+ swagger-parser-v3
+ 2.0.23
+
+ {{/dynamicOperations}}
{{#useBeanValidation}}
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.gitignore b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.gitignore
new file mode 100644
index 000000000000..a530464afa1b
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.gitignore
@@ -0,0 +1,21 @@
+*.class
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.ear
+
+# exclude jar for gradle wrapper
+!gradle/wrapper/*.jar
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+
+# build files
+**/target
+target
+.gradle
+build
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator-ignore b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator-ignore
new file mode 100644
index 000000000000..7484ee590a38
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/FILES
new file mode 100644
index 000000000000..5597480c76d3
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/FILES
@@ -0,0 +1,141 @@
+.gitignore
+.travis.yml
+README.md
+build.gradle
+build.sbt
+docs/AdditionalPropertiesAnyType.md
+docs/AdditionalPropertiesArray.md
+docs/AdditionalPropertiesBoolean.md
+docs/AdditionalPropertiesClass.md
+docs/AdditionalPropertiesInteger.md
+docs/AdditionalPropertiesNumber.md
+docs/AdditionalPropertiesObject.md
+docs/AdditionalPropertiesString.md
+docs/Animal.md
+docs/AnotherFakeApi.md
+docs/ArrayOfArrayOfNumberOnly.md
+docs/ArrayOfNumberOnly.md
+docs/ArrayTest.md
+docs/BigCat.md
+docs/BigCatAllOf.md
+docs/Capitalization.md
+docs/Cat.md
+docs/CatAllOf.md
+docs/Category.md
+docs/ClassModel.md
+docs/Client.md
+docs/Dog.md
+docs/DogAllOf.md
+docs/EnumArrays.md
+docs/EnumClass.md
+docs/EnumTest.md
+docs/FakeApi.md
+docs/FakeClassnameTags123Api.md
+docs/FileSchemaTestClass.md
+docs/FormatTest.md
+docs/HasOnlyReadOnly.md
+docs/MapTest.md
+docs/MixedPropertiesAndAdditionalPropertiesClass.md
+docs/Model200Response.md
+docs/ModelApiResponse.md
+docs/ModelReturn.md
+docs/Name.md
+docs/NumberOnly.md
+docs/Order.md
+docs/OuterComposite.md
+docs/OuterEnum.md
+docs/Pet.md
+docs/PetApi.md
+docs/ReadOnlyFirst.md
+docs/SpecialModelName.md
+docs/StoreApi.md
+docs/Tag.md
+docs/TypeHolderDefault.md
+docs/TypeHolderExample.md
+docs/User.md
+docs/UserApi.md
+docs/XmlItem.md
+git_push.sh
+gradle.properties
+gradle/wrapper/gradle-wrapper.jar
+gradle/wrapper/gradle-wrapper.properties
+gradlew
+gradlew.bat
+pom.xml
+settings.gradle
+src/main/AndroidManifest.xml
+src/main/java/org/openapitools/client/ApiCallback.java
+src/main/java/org/openapitools/client/ApiClient.java
+src/main/java/org/openapitools/client/ApiException.java
+src/main/java/org/openapitools/client/ApiOperation.java
+src/main/java/org/openapitools/client/ApiResponse.java
+src/main/java/org/openapitools/client/Configuration.java
+src/main/java/org/openapitools/client/GzipRequestInterceptor.java
+src/main/java/org/openapitools/client/JSON.java
+src/main/java/org/openapitools/client/Pair.java
+src/main/java/org/openapitools/client/ProgressRequestBody.java
+src/main/java/org/openapitools/client/ProgressResponseBody.java
+src/main/java/org/openapitools/client/ServerConfiguration.java
+src/main/java/org/openapitools/client/ServerVariable.java
+src/main/java/org/openapitools/client/StringUtil.java
+src/main/java/org/openapitools/client/api/AnotherFakeApi.java
+src/main/java/org/openapitools/client/api/FakeApi.java
+src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java
+src/main/java/org/openapitools/client/api/PetApi.java
+src/main/java/org/openapitools/client/api/StoreApi.java
+src/main/java/org/openapitools/client/api/UserApi.java
+src/main/java/org/openapitools/client/auth/ApiKeyAuth.java
+src/main/java/org/openapitools/client/auth/Authentication.java
+src/main/java/org/openapitools/client/auth/HttpBasicAuth.java
+src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
+src/main/java/org/openapitools/client/auth/OAuth.java
+src/main/java/org/openapitools/client/auth/OAuthFlow.java
+src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java
+src/main/java/org/openapitools/client/auth/RetryingOAuth.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java
+src/main/java/org/openapitools/client/model/Animal.java
+src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java
+src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java
+src/main/java/org/openapitools/client/model/ArrayTest.java
+src/main/java/org/openapitools/client/model/BigCat.java
+src/main/java/org/openapitools/client/model/BigCatAllOf.java
+src/main/java/org/openapitools/client/model/Capitalization.java
+src/main/java/org/openapitools/client/model/Cat.java
+src/main/java/org/openapitools/client/model/CatAllOf.java
+src/main/java/org/openapitools/client/model/Category.java
+src/main/java/org/openapitools/client/model/ClassModel.java
+src/main/java/org/openapitools/client/model/Client.java
+src/main/java/org/openapitools/client/model/Dog.java
+src/main/java/org/openapitools/client/model/DogAllOf.java
+src/main/java/org/openapitools/client/model/EnumArrays.java
+src/main/java/org/openapitools/client/model/EnumClass.java
+src/main/java/org/openapitools/client/model/EnumTest.java
+src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
+src/main/java/org/openapitools/client/model/FormatTest.java
+src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java
+src/main/java/org/openapitools/client/model/MapTest.java
+src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
+src/main/java/org/openapitools/client/model/Model200Response.java
+src/main/java/org/openapitools/client/model/ModelApiResponse.java
+src/main/java/org/openapitools/client/model/ModelReturn.java
+src/main/java/org/openapitools/client/model/Name.java
+src/main/java/org/openapitools/client/model/NumberOnly.java
+src/main/java/org/openapitools/client/model/Order.java
+src/main/java/org/openapitools/client/model/OuterComposite.java
+src/main/java/org/openapitools/client/model/OuterEnum.java
+src/main/java/org/openapitools/client/model/Pet.java
+src/main/java/org/openapitools/client/model/ReadOnlyFirst.java
+src/main/java/org/openapitools/client/model/SpecialModelName.java
+src/main/java/org/openapitools/client/model/Tag.java
+src/main/java/org/openapitools/client/model/TypeHolderDefault.java
+src/main/java/org/openapitools/client/model/TypeHolderExample.java
+src/main/java/org/openapitools/client/model/User.java
+src/main/java/org/openapitools/client/model/XmlItem.java
+src/main/resources/openapi/openapi.yaml
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION
new file mode 100644
index 000000000000..d99e7162d01f
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION
@@ -0,0 +1 @@
+5.0.0-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.travis.yml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.travis.yml
new file mode 100644
index 000000000000..1b6741c083c7
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.travis.yml
@@ -0,0 +1,22 @@
+#
+# Generated by OpenAPI Generator: https://openapi-generator.tech
+#
+# Ref: https://docs.travis-ci.com/user/languages/java/
+#
+language: java
+jdk:
+ - openjdk12
+ - openjdk11
+ - openjdk10
+ - openjdk9
+ - openjdk8
+before_install:
+ # ensure gradlew has proper permission
+ - chmod a+x ./gradlew
+script:
+ # test using maven
+ #- mvn test
+ # test using gradle
+ - gradle test
+ # test using sbt
+ # - sbt test
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/README.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/README.md
new file mode 100644
index 000000000000..55885745728d
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/README.md
@@ -0,0 +1,234 @@
+# petstore-okhttp-gson-dynamicoperations
+
+OpenAPI Petstore
+- API version: 1.0.0
+
+This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+
+*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
+
+
+## Requirements
+
+Building the API client library requires:
+1. Java 1.7+
+2. Maven/Gradle
+
+## Installation
+
+To install the API client library to your local Maven repository, simply execute:
+
+```shell
+mvn clean install
+```
+
+To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
+
+```shell
+mvn clean deploy
+```
+
+Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
+
+### Maven users
+
+Add this dependency to your project's POM:
+
+```xml
+
+ org.openapitools
+ petstore-okhttp-gson-dynamicoperations
+ 1.0.0
+ compile
+
+```
+
+### Gradle users
+
+Add this dependency to your project's build file:
+
+```groovy
+compile "org.openapitools:petstore-okhttp-gson-dynamicoperations:1.0.0"
+```
+
+### Others
+
+At first generate the JAR by executing:
+
+```shell
+mvn clean package
+```
+
+Then manually install the following JARs:
+
+* `target/petstore-okhttp-gson-dynamicoperations-1.0.0.jar`
+* `target/lib/*.jar`
+
+## Getting Started
+
+Please follow the [installation](#installation) instruction and execute the following Java code:
+
+```java
+
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.AnotherFakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient);
+ Client body = new Client(); // Client | client model
+ try {
+ Client result = apiInstance.call123testSpecialTags(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
+*FakeApi* | [**createXmlItem**](docs/FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem
+*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
+*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
+*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
+*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
+*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
+*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
+*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
+*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
+*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
+*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
+*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
+*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters |
+*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
+*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
+*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
+*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
+*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
+*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
+*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
+*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
+*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
+*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
+*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
+*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
+*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
+*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user
+*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
+*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
+*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
+*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
+*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
+*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
+*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
+
+
+## Documentation for Models
+
+ - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md)
+ - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md)
+ - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md)
+ - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
+ - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md)
+ - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md)
+ - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md)
+ - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md)
+ - [Animal](docs/Animal.md)
+ - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
+ - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
+ - [ArrayTest](docs/ArrayTest.md)
+ - [BigCat](docs/BigCat.md)
+ - [BigCatAllOf](docs/BigCatAllOf.md)
+ - [Capitalization](docs/Capitalization.md)
+ - [Cat](docs/Cat.md)
+ - [CatAllOf](docs/CatAllOf.md)
+ - [Category](docs/Category.md)
+ - [ClassModel](docs/ClassModel.md)
+ - [Client](docs/Client.md)
+ - [Dog](docs/Dog.md)
+ - [DogAllOf](docs/DogAllOf.md)
+ - [EnumArrays](docs/EnumArrays.md)
+ - [EnumClass](docs/EnumClass.md)
+ - [EnumTest](docs/EnumTest.md)
+ - [FileSchemaTestClass](docs/FileSchemaTestClass.md)
+ - [FormatTest](docs/FormatTest.md)
+ - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
+ - [MapTest](docs/MapTest.md)
+ - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
+ - [Model200Response](docs/Model200Response.md)
+ - [ModelApiResponse](docs/ModelApiResponse.md)
+ - [ModelReturn](docs/ModelReturn.md)
+ - [Name](docs/Name.md)
+ - [NumberOnly](docs/NumberOnly.md)
+ - [Order](docs/Order.md)
+ - [OuterComposite](docs/OuterComposite.md)
+ - [OuterEnum](docs/OuterEnum.md)
+ - [Pet](docs/Pet.md)
+ - [ReadOnlyFirst](docs/ReadOnlyFirst.md)
+ - [SpecialModelName](docs/SpecialModelName.md)
+ - [Tag](docs/Tag.md)
+ - [TypeHolderDefault](docs/TypeHolderDefault.md)
+ - [TypeHolderExample](docs/TypeHolderExample.md)
+ - [User](docs/User.md)
+ - [XmlItem](docs/XmlItem.md)
+
+
+## Documentation for Authorization
+
+Authentication schemes defined for the API:
+### api_key
+
+- **Type**: API key
+- **API key parameter name**: api_key
+- **Location**: HTTP header
+
+### api_key_query
+
+- **Type**: API key
+- **API key parameter name**: api_key_query
+- **Location**: URL query string
+
+### http_basic_test
+
+- **Type**: HTTP basic authentication
+
+### petstore_auth
+
+- **Type**: OAuth
+- **Flow**: implicit
+- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
+- **Scopes**:
+ - write:pets: modify pets in your account
+ - read:pets: read your pets
+
+
+## Recommendation
+
+It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
+
+## Author
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle
new file mode 100644
index 000000000000..20a03b5ade6c
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle
@@ -0,0 +1,117 @@
+apply plugin: 'idea'
+apply plugin: 'eclipse'
+apply plugin: 'java'
+
+group = 'org.openapitools'
+version = '1.0.0'
+
+buildscript {
+ repositories {
+ maven { url "https://repo1.maven.org/maven2" }
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:2.3.+'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
+ }
+}
+
+repositories {
+ jcenter()
+}
+sourceSets {
+ main.java.srcDirs = ['src/main/java']
+}
+
+if(hasProperty('target') && target == 'android') {
+
+ apply plugin: 'com.android.library'
+ apply plugin: 'com.github.dcendents.android-maven'
+
+ android {
+ compileSdkVersion 25
+ buildToolsVersion '25.0.2'
+ defaultConfig {
+ minSdkVersion 14
+ targetSdkVersion 25
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_7
+ targetCompatibility JavaVersion.VERSION_1_7
+ }
+
+ // Rename the aar correctly
+ libraryVariants.all { variant ->
+ variant.outputs.each { output ->
+ def outputFile = output.outputFile
+ if (outputFile != null && outputFile.name.endsWith('.aar')) {
+ def fileName = "${project.name}-${variant.baseName}-${version}.aar"
+ output.outputFile = new File(outputFile.parent, fileName)
+ }
+ }
+ }
+
+ dependencies {
+ provided 'javax.annotation:javax.annotation-api:1.3.2'
+ }
+ }
+
+ afterEvaluate {
+ android.libraryVariants.all { variant ->
+ def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
+ task.description = "Create jar artifact for ${variant.name}"
+ task.dependsOn variant.javaCompile
+ task.from variant.javaCompile.destinationDir
+ task.destinationDir = project.file("${project.buildDir}/outputs/jar")
+ task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
+ artifacts.add('archives', task);
+ }
+ }
+
+ task sourcesJar(type: Jar) {
+ from android.sourceSets.main.java.srcDirs
+ classifier = 'sources'
+ }
+
+ artifacts {
+ archives sourcesJar
+ }
+
+} else {
+
+ apply plugin: 'java'
+ apply plugin: 'maven'
+
+ sourceCompatibility = JavaVersion.VERSION_1_7
+ targetCompatibility = JavaVersion.VERSION_1_7
+
+ install {
+ repositories.mavenInstaller {
+ pom.artifactId = 'petstore-okhttp-gson-dynamicoperations'
+ }
+ }
+
+ task execute(type:JavaExec) {
+ main = System.getProperty('mainClass')
+ classpath = sourceSets.main.runtimeClasspath
+ }
+}
+
+dependencies {
+ compile 'io.swagger:swagger-annotations:1.5.24'
+ compile "com.google.code.findbugs:jsr305:3.0.2"
+ compile 'com.squareup.okhttp3:okhttp:3.14.7'
+ compile 'com.squareup.okhttp3:logging-interceptor:3.14.7'
+ compile 'com.google.code.gson:gson:2.8.6'
+ compile 'io.gsonfire:gson-fire:1.8.4'
+ compile group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1'
+ compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'
+ compile 'org.threeten:threetenbp:1.4.3'
+ compile 'io.swagger.parser.v3:swagger-parser-v3:2.0.23'
+ compile 'javax.annotation:javax.annotation-api:1.3.2'
+ testCompile 'junit:junit:4.13.1'
+}
+
+javadoc {
+ options.tags = [ "http.response.details:a:Http Response Details" ]
+}
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt
new file mode 100644
index 000000000000..289532fdd680
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt
@@ -0,0 +1,27 @@
+lazy val root = (project in file(".")).
+ settings(
+ organization := "org.openapitools",
+ name := "petstore-okhttp-gson-dynamicoperations",
+ version := "1.0.0",
+ scalaVersion := "2.11.4",
+ scalacOptions ++= Seq("-feature"),
+ javacOptions in compile ++= Seq("-Xlint:deprecation"),
+ publishArtifact in (Compile, packageDoc) := false,
+ resolvers += Resolver.mavenLocal,
+ libraryDependencies ++= Seq(
+ "io.swagger" % "swagger-annotations" % "1.5.24",
+ "com.squareup.okhttp3" % "okhttp" % "3.14.7",
+ "com.squareup.okhttp3" % "logging-interceptor" % "3.14.7",
+ "com.google.code.gson" % "gson" % "2.8.6",
+ "org.apache.commons" % "commons-lang3" % "3.10",
+ "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1",
+ "org.threeten" % "threetenbp" % "1.4.3" % "compile",
+ "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.23" % "compile"
+ "io.gsonfire" % "gson-fire" % "1.8.3" % "compile",
+ "javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
+ "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile",
+ "javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
+ "junit" % "junit" % "4.13.1" % "test",
+ "com.novocode" % "junit-interface" % "0.10" % "test"
+ )
+ )
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesAnyType.md
new file mode 100644
index 000000000000..87b468bb7ca3
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesAnyType.md
@@ -0,0 +1,12 @@
+
+
+# AdditionalPropertiesAnyType
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesArray.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesArray.md
new file mode 100644
index 000000000000..cb7fe9b3903d
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesArray.md
@@ -0,0 +1,12 @@
+
+
+# AdditionalPropertiesArray
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesBoolean.md
new file mode 100644
index 000000000000..6b53e7ba73a1
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesBoolean.md
@@ -0,0 +1,12 @@
+
+
+# AdditionalPropertiesBoolean
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesClass.md
new file mode 100644
index 000000000000..ffab911c1be8
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesClass.md
@@ -0,0 +1,22 @@
+
+
+# AdditionalPropertiesClass
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mapString** | **Map<String, String>** | | [optional]
+**mapNumber** | [**Map<String, BigDecimal>**](BigDecimal.md) | | [optional]
+**mapInteger** | **Map<String, Integer>** | | [optional]
+**mapBoolean** | **Map<String, Boolean>** | | [optional]
+**mapArrayInteger** | [**Map<String, List<Integer>>**](List.md) | | [optional]
+**mapArrayAnytype** | [**Map<String, List<Object>>**](List.md) | | [optional]
+**mapMapString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional]
+**mapMapAnytype** | [**Map<String, Map<String, Object>>**](Map.md) | | [optional]
+**anytype1** | **Object** | | [optional]
+**anytype2** | **Object** | | [optional]
+**anytype3** | **Object** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesInteger.md
new file mode 100644
index 000000000000..d2ed7fb1a460
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesInteger.md
@@ -0,0 +1,12 @@
+
+
+# AdditionalPropertiesInteger
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesNumber.md
new file mode 100644
index 000000000000..53f6e81e7176
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesNumber.md
@@ -0,0 +1,12 @@
+
+
+# AdditionalPropertiesNumber
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesObject.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesObject.md
new file mode 100644
index 000000000000..98ac8d2e5fe0
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesObject.md
@@ -0,0 +1,12 @@
+
+
+# AdditionalPropertiesObject
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesString.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesString.md
new file mode 100644
index 000000000000..d7970cdfe190
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AdditionalPropertiesString.md
@@ -0,0 +1,12 @@
+
+
+# AdditionalPropertiesString
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Animal.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Animal.md
new file mode 100644
index 000000000000..c8e18ae55e4f
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Animal.md
@@ -0,0 +1,13 @@
+
+
+# Animal
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**className** | **String** | |
+**color** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AnotherFakeApi.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AnotherFakeApi.md
new file mode 100644
index 000000000000..0565c2589b3c
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/AnotherFakeApi.md
@@ -0,0 +1,71 @@
+# AnotherFakeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
+
+
+
+# **call123testSpecialTags**
+> Client call123testSpecialTags(body)
+
+To test special tags
+
+To test special tags and operation ID starting with number
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.AnotherFakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient);
+ Client body = new Client(); // Client | client model
+ try {
+ Client result = apiInstance.call123testSpecialTags(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Client**](Client.md)| client model |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ArrayOfArrayOfNumberOnly.md
new file mode 100644
index 000000000000..a48aa23e78ee
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ArrayOfArrayOfNumberOnly.md
@@ -0,0 +1,12 @@
+
+
+# ArrayOfArrayOfNumberOnly
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayArrayNumber** | [**List<List<BigDecimal>>**](List.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ArrayOfNumberOnly.md
new file mode 100644
index 000000000000..fa2909211a07
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ArrayOfNumberOnly.md
@@ -0,0 +1,12 @@
+
+
+# ArrayOfNumberOnly
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayNumber** | [**List<BigDecimal>**](BigDecimal.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ArrayTest.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ArrayTest.md
new file mode 100644
index 000000000000..9ad1c9814a51
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ArrayTest.md
@@ -0,0 +1,14 @@
+
+
+# ArrayTest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayOfString** | **List<String>** | | [optional]
+**arrayArrayOfInteger** | [**List<List<Long>>**](List.md) | | [optional]
+**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/BigCat.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/BigCat.md
new file mode 100644
index 000000000000..8a075304abf8
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/BigCat.md
@@ -0,0 +1,23 @@
+
+
+# BigCat
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**kind** | [**KindEnum**](#KindEnum) | | [optional]
+
+
+
+## Enum: KindEnum
+
+Name | Value
+---- | -----
+LIONS | "lions"
+TIGERS | "tigers"
+LEOPARDS | "leopards"
+JAGUARS | "jaguars"
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/BigCatAllOf.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/BigCatAllOf.md
new file mode 100644
index 000000000000..21177dbf089d
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/BigCatAllOf.md
@@ -0,0 +1,23 @@
+
+
+# BigCatAllOf
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**kind** | [**KindEnum**](#KindEnum) | | [optional]
+
+
+
+## Enum: KindEnum
+
+Name | Value
+---- | -----
+LIONS | "lions"
+TIGERS | "tigers"
+LEOPARDS | "leopards"
+JAGUARS | "jaguars"
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Capitalization.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Capitalization.md
new file mode 100644
index 000000000000..7b73c40b5545
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Capitalization.md
@@ -0,0 +1,17 @@
+
+
+# Capitalization
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**smallCamel** | **String** | | [optional]
+**capitalCamel** | **String** | | [optional]
+**smallSnake** | **String** | | [optional]
+**capitalSnake** | **String** | | [optional]
+**scAETHFlowPoints** | **String** | | [optional]
+**ATT_NAME** | **String** | Name of the pet | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Cat.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Cat.md
new file mode 100644
index 000000000000..39c2f864df88
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Cat.md
@@ -0,0 +1,12 @@
+
+
+# Cat
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**declawed** | **Boolean** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/CatAllOf.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/CatAllOf.md
new file mode 100644
index 000000000000..1098fd900c5d
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/CatAllOf.md
@@ -0,0 +1,12 @@
+
+
+# CatAllOf
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**declawed** | **Boolean** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Category.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Category.md
new file mode 100644
index 000000000000..613ea9f7ee24
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Category.md
@@ -0,0 +1,13 @@
+
+
+# Category
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**name** | **String** | |
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ClassModel.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ClassModel.md
new file mode 100644
index 000000000000..d5453c20133a
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ClassModel.md
@@ -0,0 +1,13 @@
+
+
+# ClassModel
+
+Model for testing model with \"_class\" property
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**propertyClass** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Client.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Client.md
new file mode 100644
index 000000000000..228df492383f
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Client.md
@@ -0,0 +1,12 @@
+
+
+# Client
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**client** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Dog.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Dog.md
new file mode 100644
index 000000000000..73cedf2bc919
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Dog.md
@@ -0,0 +1,12 @@
+
+
+# Dog
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**breed** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/DogAllOf.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/DogAllOf.md
new file mode 100644
index 000000000000..cbeb9e9a22df
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/DogAllOf.md
@@ -0,0 +1,12 @@
+
+
+# DogAllOf
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**breed** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/EnumArrays.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/EnumArrays.md
new file mode 100644
index 000000000000..869b7a6c066d
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/EnumArrays.md
@@ -0,0 +1,31 @@
+
+
+# EnumArrays
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional]
+**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional]
+
+
+
+## Enum: JustSymbolEnum
+
+Name | Value
+---- | -----
+GREATER_THAN_OR_EQUAL_TO | ">="
+DOLLAR | "$"
+
+
+
+## Enum: List<ArrayEnumEnum>
+
+Name | Value
+---- | -----
+FISH | "fish"
+CRAB | "crab"
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/EnumClass.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/EnumClass.md
new file mode 100644
index 000000000000..b314590a7591
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/EnumClass.md
@@ -0,0 +1,15 @@
+
+
+# EnumClass
+
+## Enum
+
+
+* `_ABC` (value: `"_abc"`)
+
+* `_EFG` (value: `"-efg"`)
+
+* `_XYZ_` (value: `"(xyz)"`)
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/EnumTest.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/EnumTest.md
new file mode 100644
index 000000000000..61eb95f22fe9
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/EnumTest.md
@@ -0,0 +1,54 @@
+
+
+# EnumTest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
+**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | |
+**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional]
+**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional]
+**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional]
+
+
+
+## Enum: EnumStringEnum
+
+Name | Value
+---- | -----
+UPPER | "UPPER"
+LOWER | "lower"
+EMPTY | ""
+
+
+
+## Enum: EnumStringRequiredEnum
+
+Name | Value
+---- | -----
+UPPER | "UPPER"
+LOWER | "lower"
+EMPTY | ""
+
+
+
+## Enum: EnumIntegerEnum
+
+Name | Value
+---- | -----
+NUMBER_1 | 1
+NUMBER_MINUS_1 | -1
+
+
+
+## Enum: EnumNumberEnum
+
+Name | Value
+---- | -----
+NUMBER_1_DOT_1 | 1.1
+NUMBER_MINUS_1_DOT_2 | -1.2
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FakeApi.md
new file mode 100644
index 000000000000..b8c2112acb88
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FakeApi.md
@@ -0,0 +1,949 @@
+# FakeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**createXmlItem**](FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem
+[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
+[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
+[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
+[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
+[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
+[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
+[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
+[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
+[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
+[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
+[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
+[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters |
+
+
+
+# **createXmlItem**
+> createXmlItem(xmlItem)
+
+creates an XmlItem
+
+this route creates an XmlItem
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ XmlItem xmlItem = new XmlItem(); // XmlItem | XmlItem Body
+ try {
+ apiInstance.createXmlItem(xmlItem);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#createXmlItem");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **xmlItem** | [**XmlItem**](XmlItem.md)| XmlItem Body |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+
+# **fakeOuterBooleanSerialize**
+> Boolean fakeOuterBooleanSerialize(body)
+
+
+
+Test serialization of outer boolean types
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ Boolean body = true; // Boolean | Input boolean as post body
+ try {
+ Boolean result = apiInstance.fakeOuterBooleanSerialize(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **Boolean**| Input boolean as post body | [optional]
+
+### Return type
+
+**Boolean**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output boolean | - |
+
+
+# **fakeOuterCompositeSerialize**
+> OuterComposite fakeOuterCompositeSerialize(body)
+
+
+
+Test serialization of object with outer number type
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body
+ try {
+ OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
+
+### Return type
+
+[**OuterComposite**](OuterComposite.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output composite | - |
+
+
+# **fakeOuterNumberSerialize**
+> BigDecimal fakeOuterNumberSerialize(body)
+
+
+
+Test serialization of outer number types
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body
+ try {
+ BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **BigDecimal**| Input number as post body | [optional]
+
+### Return type
+
+[**BigDecimal**](BigDecimal.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output number | - |
+
+
+# **fakeOuterStringSerialize**
+> String fakeOuterStringSerialize(body)
+
+
+
+Test serialization of outer string types
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ String body = "body_example"; // String | Input string as post body
+ try {
+ String result = apiInstance.fakeOuterStringSerialize(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **String**| Input string as post body | [optional]
+
+### Return type
+
+**String**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output string | - |
+
+
+# **testBodyWithFileSchema**
+> testBodyWithFileSchema(body)
+
+
+
+For this test, the body for this request much reference a schema named `File`.
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ FileSchemaTestClass body = new FileSchemaTestClass(); // FileSchemaTestClass |
+ try {
+ apiInstance.testBodyWithFileSchema(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
+
+# **testBodyWithQueryParams**
+> testBodyWithQueryParams(query, body)
+
+
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ String query = "query_example"; // String |
+ User body = new User(); // User |
+ try {
+ apiInstance.testBodyWithQueryParams(query, body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testBodyWithQueryParams");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **query** | **String**| |
+ **body** | [**User**](User.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
+
+# **testClientModel**
+> Client testClientModel(body)
+
+To test \"client\" model
+
+To test \"client\" model
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ Client body = new Client(); // Client | client model
+ try {
+ Client result = apiInstance.testClientModel(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testClientModel");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Client**](Client.md)| client model |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+
+# **testEndpointParameters**
+> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback)
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure HTTP basic authorization: http_basic_test
+ HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test");
+ http_basic_test.setUsername("YOUR USERNAME");
+ http_basic_test.setPassword("YOUR PASSWORD");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ BigDecimal number = new BigDecimal(); // BigDecimal | None
+ Double _double = 3.4D; // Double | None
+ String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
+ byte[] _byte = null; // byte[] | None
+ Integer integer = 56; // Integer | None
+ Integer int32 = 56; // Integer | None
+ Long int64 = 56L; // Long | None
+ Float _float = 3.4F; // Float | None
+ String string = "string_example"; // String | None
+ File binary = new File("/path/to/file"); // File | None
+ LocalDate date = new LocalDate(); // LocalDate | None
+ OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None
+ String password = "password_example"; // String | None
+ String paramCallback = "paramCallback_example"; // String | None
+ try {
+ apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testEndpointParameters");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **number** | **BigDecimal**| None |
+ **_double** | **Double**| None |
+ **patternWithoutDelimiter** | **String**| None |
+ **_byte** | **byte[]**| None |
+ **integer** | **Integer**| None | [optional]
+ **int32** | **Integer**| None | [optional]
+ **int64** | **Long**| None | [optional]
+ **_float** | **Float**| None | [optional]
+ **string** | **String**| None | [optional]
+ **binary** | **File**| None | [optional]
+ **date** | **LocalDate**| None | [optional]
+ **dateTime** | **OffsetDateTime**| None | [optional]
+ **password** | **String**| None | [optional]
+ **paramCallback** | **String**| None | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[http_basic_test](../README.md#http_basic_test)
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**400** | Invalid username supplied | - |
+**404** | User not found | - |
+
+
+# **testEnumParameters**
+> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString)
+
+To test enum parameters
+
+To test enum parameters
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array)
+ String enumHeaderString = "-efg"; // String | Header parameter enum test (string)
+ List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array)
+ String enumQueryString = "-efg"; // String | Query parameter enum test (string)
+ Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double)
+ Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double)
+ List enumFormStringArray = "$"; // List | Form parameter enum test (string array)
+ String enumFormString = "-efg"; // String | Form parameter enum test (string)
+ try {
+ apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testEnumParameters");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $]
+ **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
+ **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $]
+ **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
+ **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2]
+ **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2]
+ **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $]
+ **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**400** | Invalid request | - |
+**404** | Not found | - |
+
+
+# **testGroupParameters**
+> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group).stringGroup(stringGroup).booleanGroup(booleanGroup).int64Group(int64Group).execute();
+
+Fake endpoint to test group parameters (optional)
+
+Fake endpoint to test group parameters (optional)
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ Integer requiredStringGroup = 56; // Integer | Required String in group parameters
+ Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters
+ Long requiredInt64Group = 56L; // Long | Required Integer in group parameters
+ Integer stringGroup = 56; // Integer | String in group parameters
+ Boolean booleanGroup = true; // Boolean | Boolean in group parameters
+ Long int64Group = 56L; // Long | Integer in group parameters
+ try {
+ apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group)
+ .stringGroup(stringGroup)
+ .booleanGroup(booleanGroup)
+ .int64Group(int64Group)
+ .execute();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testGroupParameters");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **requiredStringGroup** | **Integer**| Required String in group parameters |
+ **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters |
+ **requiredInt64Group** | **Long**| Required Integer in group parameters |
+ **stringGroup** | **Integer**| String in group parameters | [optional]
+ **booleanGroup** | **Boolean**| Boolean in group parameters | [optional]
+ **int64Group** | **Long**| Integer in group parameters | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**400** | Someting wrong | - |
+
+
+# **testInlineAdditionalProperties**
+> testInlineAdditionalProperties(param)
+
+test inline additionalProperties
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ Map param = new HashMap(); // Map | request body
+ try {
+ apiInstance.testInlineAdditionalProperties(param);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **param** | [**Map<String, String>**](String.md)| request body |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+
+# **testJsonFormData**
+> testJsonFormData(param, param2)
+
+test json serialization of form data
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ String param = "param_example"; // String | field1
+ String param2 = "param2_example"; // String | field2
+ try {
+ apiInstance.testJsonFormData(param, param2);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testJsonFormData");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **param** | **String**| field1 |
+ **param2** | **String**| field2 |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+
+# **testQueryParameterCollectionFormat**
+> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context)
+
+
+
+To test the collection format in query parameters
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ List pipe = Arrays.asList(); // List |
+ List ioutil = Arrays.asList(); // List |
+ List http = Arrays.asList(); // List |
+ List url = Arrays.asList(); // List |
+ List context = Arrays.asList(); // List |
+ try {
+ apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pipe** | [**List<String>**](String.md)| |
+ **ioutil** | [**List<String>**](String.md)| |
+ **http** | [**List<String>**](String.md)| |
+ **url** | [**List<String>**](String.md)| |
+ **context** | [**List<String>**](String.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FakeClassnameTags123Api.md
new file mode 100644
index 000000000000..bd934e360718
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FakeClassnameTags123Api.md
@@ -0,0 +1,78 @@
+# FakeClassnameTags123Api
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
+
+
+
+# **testClassname**
+> Client testClassname(body)
+
+To test class name in snake case
+
+To test class name in snake case
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.FakeClassnameTags123Api;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure API key authorization: api_key_query
+ ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query");
+ api_key_query.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //api_key_query.setApiKeyPrefix("Token");
+
+ FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient);
+ Client body = new Client(); // Client | client model
+ try {
+ Client result = apiInstance.testClassname(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeClassnameTags123Api#testClassname");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Client**](Client.md)| client model |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+[api_key_query](../README.md#api_key_query)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FileSchemaTestClass.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FileSchemaTestClass.md
new file mode 100644
index 000000000000..3a95e27d7c09
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FileSchemaTestClass.md
@@ -0,0 +1,13 @@
+
+
+# FileSchemaTestClass
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**file** | [**java.io.File**](java.io.File.md) | | [optional]
+**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FormatTest.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FormatTest.md
new file mode 100644
index 000000000000..d138e921902a
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FormatTest.md
@@ -0,0 +1,25 @@
+
+
+# FormatTest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**integer** | **Integer** | | [optional]
+**int32** | **Integer** | | [optional]
+**int64** | **Long** | | [optional]
+**number** | [**BigDecimal**](BigDecimal.md) | |
+**_float** | **Float** | | [optional]
+**_double** | **Double** | | [optional]
+**string** | **String** | | [optional]
+**_byte** | **byte[]** | |
+**binary** | [**File**](File.md) | | [optional]
+**date** | [**LocalDate**](LocalDate.md) | |
+**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
+**uuid** | [**UUID**](UUID.md) | | [optional]
+**password** | **String** | |
+**bigDecimal** | [**BigDecimal**](BigDecimal.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/HasOnlyReadOnly.md
new file mode 100644
index 000000000000..4795b40ef65e
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/HasOnlyReadOnly.md
@@ -0,0 +1,13 @@
+
+
+# HasOnlyReadOnly
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **String** | | [optional] [readonly]
+**foo** | **String** | | [optional] [readonly]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/MapTest.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/MapTest.md
new file mode 100644
index 000000000000..c35c3cf2c0be
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/MapTest.md
@@ -0,0 +1,24 @@
+
+
+# MapTest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional]
+**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional]
+**directMap** | **Map<String, Boolean>** | | [optional]
+**indirectMap** | **Map<String, Boolean>** | | [optional]
+
+
+
+## Enum: Map<String, InnerEnum>
+
+Name | Value
+---- | -----
+UPPER | "UPPER"
+LOWER | "lower"
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/MixedPropertiesAndAdditionalPropertiesClass.md
new file mode 100644
index 000000000000..3dc283ae4936
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -0,0 +1,14 @@
+
+
+# MixedPropertiesAndAdditionalPropertiesClass
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uuid** | [**UUID**](UUID.md) | | [optional]
+**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
+**map** | [**Map<String, Animal>**](Animal.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Model200Response.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Model200Response.md
new file mode 100644
index 000000000000..f9928d70622c
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Model200Response.md
@@ -0,0 +1,14 @@
+
+
+# Model200Response
+
+Model for testing model name starting with number
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **Integer** | | [optional]
+**propertyClass** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelApiResponse.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelApiResponse.md
new file mode 100644
index 000000000000..14fb7f1ed27b
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelApiResponse.md
@@ -0,0 +1,14 @@
+
+
+# ModelApiResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **Integer** | | [optional]
+**type** | **String** | | [optional]
+**message** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelReturn.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelReturn.md
new file mode 100644
index 000000000000..5005d4b72392
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelReturn.md
@@ -0,0 +1,13 @@
+
+
+# ModelReturn
+
+Model for testing reserved words
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**_return** | **Integer** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Name.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Name.md
new file mode 100644
index 000000000000..b815a0b4c994
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Name.md
@@ -0,0 +1,16 @@
+
+
+# Name
+
+Model for testing model name same as property name
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **Integer** | |
+**snakeCase** | **Integer** | | [optional] [readonly]
+**property** | **String** | | [optional]
+**_123number** | **Integer** | | [optional] [readonly]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/NumberOnly.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/NumberOnly.md
new file mode 100644
index 000000000000..1c12b6adf3bd
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/NumberOnly.md
@@ -0,0 +1,12 @@
+
+
+# NumberOnly
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Order.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Order.md
new file mode 100644
index 000000000000..409fc4cc9616
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Order.md
@@ -0,0 +1,27 @@
+
+
+# Order
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**petId** | **Long** | | [optional]
+**quantity** | **Integer** | | [optional]
+**shipDate** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
+**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional]
+**complete** | **Boolean** | | [optional]
+
+
+
+## Enum: StatusEnum
+
+Name | Value
+---- | -----
+PLACED | "placed"
+APPROVED | "approved"
+DELIVERED | "delivered"
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/OuterComposite.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/OuterComposite.md
new file mode 100644
index 000000000000..e06292218847
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/OuterComposite.md
@@ -0,0 +1,14 @@
+
+
+# OuterComposite
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
+**myString** | **String** | | [optional]
+**myBoolean** | **Boolean** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/OuterEnum.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/OuterEnum.md
new file mode 100644
index 000000000000..1f9b723eb8e7
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/OuterEnum.md
@@ -0,0 +1,15 @@
+
+
+# OuterEnum
+
+## Enum
+
+
+* `PLACED` (value: `"placed"`)
+
+* `APPROVED` (value: `"approved"`)
+
+* `DELIVERED` (value: `"delivered"`)
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Pet.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Pet.md
new file mode 100644
index 000000000000..bdcdad6b3e60
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Pet.md
@@ -0,0 +1,27 @@
+
+
+# Pet
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**category** | [**Category**](Category.md) | | [optional]
+**name** | **String** | |
+**photoUrls** | **Set<String>** | |
+**tags** | [**List<Tag>**](Tag.md) | | [optional]
+**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional]
+
+
+
+## Enum: StatusEnum
+
+Name | Value
+---- | -----
+AVAILABLE | "available"
+PENDING | "pending"
+SOLD | "sold"
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/PetApi.md
new file mode 100644
index 000000000000..8d927130ceee
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/PetApi.md
@@ -0,0 +1,629 @@
+# PetApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
+[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
+[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
+[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
+[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
+[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
+[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
+[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
+[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+
+
+
+# **addPet**
+> addPet(body)
+
+Add a new pet to the store
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
+ try {
+ apiInstance.addPet(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#addPet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**405** | Invalid input | - |
+
+
+# **deletePet**
+> deletePet(petId, apiKey)
+
+Deletes a pet
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | Pet id to delete
+ String apiKey = "apiKey_example"; // String |
+ try {
+ apiInstance.deletePet(petId, apiKey);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#deletePet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| Pet id to delete |
+ **apiKey** | **String**| | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid pet value | - |
+
+
+# **findPetsByStatus**
+> List<Pet> findPetsByStatus(status)
+
+Finds Pets by status
+
+Multiple status values can be provided with comma separated strings
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ List status = Arrays.asList("available"); // List | Status values that need to be considered for filter
+ try {
+ List result = apiInstance.findPetsByStatus(status);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#findPetsByStatus");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
+
+### Return type
+
+[**List<Pet>**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid status value | - |
+
+
+# **findPetsByTags**
+> Set<Pet> findPetsByTags(tags)
+
+Finds Pets by tags
+
+Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Set tags = Arrays.asList(); // Set | Tags to filter by
+ try {
+ Set result = apiInstance.findPetsByTags(tags);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#findPetsByTags");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **tags** | [**Set<String>**](String.md)| Tags to filter by |
+
+### Return type
+
+[**Set<Pet>**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid tag value | - |
+
+
+# **getPetById**
+> Pet getPetById(petId)
+
+Find pet by ID
+
+Returns a single pet
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure API key authorization: api_key
+ ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
+ api_key.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //api_key.setApiKeyPrefix("Token");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | ID of pet to return
+ try {
+ Pet result = apiInstance.getPetById(petId);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#getPetById");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet to return |
+
+### Return type
+
+[**Pet**](Pet.md)
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid ID supplied | - |
+**404** | Pet not found | - |
+
+
+# **updatePet**
+> updatePet(body)
+
+Update an existing pet
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
+ try {
+ apiInstance.updatePet(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#updatePet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid ID supplied | - |
+**404** | Pet not found | - |
+**405** | Validation exception | - |
+
+
+# **updatePetWithForm**
+> updatePetWithForm(petId, name, status)
+
+Updates a pet in the store with form data
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | ID of pet that needs to be updated
+ String name = "name_example"; // String | Updated name of the pet
+ String status = "status_example"; // String | Updated status of the pet
+ try {
+ apiInstance.updatePetWithForm(petId, name, status);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#updatePetWithForm");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet that needs to be updated |
+ **name** | **String**| Updated name of the pet | [optional]
+ **status** | **String**| Updated status of the pet | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**405** | Invalid input | - |
+
+
+# **uploadFile**
+> ModelApiResponse uploadFile(petId, additionalMetadata, file)
+
+uploads an image
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | ID of pet to update
+ String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
+ File file = new File("/path/to/file"); // File | file to upload
+ try {
+ ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#uploadFile");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet to update |
+ **additionalMetadata** | **String**| Additional data to pass to server | [optional]
+ **file** | **File**| file to upload | [optional]
+
+### Return type
+
+[**ModelApiResponse**](ModelApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+
+# **uploadFileWithRequiredFile**
+> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata)
+
+uploads an image (required)
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | ID of pet to update
+ File requiredFile = new File("/path/to/file"); // File | file to upload
+ String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
+ try {
+ ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet to update |
+ **requiredFile** | **File**| file to upload |
+ **additionalMetadata** | **String**| Additional data to pass to server | [optional]
+
+### Return type
+
+[**ModelApiResponse**](ModelApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ReadOnlyFirst.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ReadOnlyFirst.md
new file mode 100644
index 000000000000..a692499dc661
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ReadOnlyFirst.md
@@ -0,0 +1,13 @@
+
+
+# ReadOnlyFirst
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **String** | | [optional] [readonly]
+**baz** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/SpecialModelName.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/SpecialModelName.md
new file mode 100644
index 000000000000..934b8f0f25d7
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/SpecialModelName.md
@@ -0,0 +1,12 @@
+
+
+# SpecialModelName
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**$specialPropertyName** | **Long** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/StoreApi.md
new file mode 100644
index 000000000000..a86b478e55ab
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/StoreApi.md
@@ -0,0 +1,264 @@
+# StoreApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
+[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
+[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
+[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
+
+
+
+# **deleteOrder**
+> deleteOrder(orderId)
+
+Delete purchase order by ID
+
+For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.StoreApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ StoreApi apiInstance = new StoreApi(defaultClient);
+ String orderId = "orderId_example"; // String | ID of the order that needs to be deleted
+ try {
+ apiInstance.deleteOrder(orderId);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#deleteOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **String**| ID of the order that needs to be deleted |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**400** | Invalid ID supplied | - |
+**404** | Order not found | - |
+
+
+# **getInventory**
+> Map<String, Integer> getInventory()
+
+Returns pet inventories by status
+
+Returns a map of status codes to quantities
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.StoreApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure API key authorization: api_key
+ ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
+ api_key.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //api_key.setApiKeyPrefix("Token");
+
+ StoreApi apiInstance = new StoreApi(defaultClient);
+ try {
+ Map result = apiInstance.getInventory();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#getInventory");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+**Map<String, Integer>**
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+
+# **getOrderById**
+> Order getOrderById(orderId)
+
+Find purchase order by ID
+
+For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.StoreApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ StoreApi apiInstance = new StoreApi(defaultClient);
+ Long orderId = 56L; // Long | ID of pet that needs to be fetched
+ try {
+ Order result = apiInstance.getOrderById(orderId);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#getOrderById");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **Long**| ID of pet that needs to be fetched |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid ID supplied | - |
+**404** | Order not found | - |
+
+
+# **placeOrder**
+> Order placeOrder(body)
+
+Place an order for a pet
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.StoreApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ StoreApi apiInstance = new StoreApi(defaultClient);
+ Order body = new Order(); // Order | order placed for purchasing the pet
+ try {
+ Order result = apiInstance.placeOrder(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#placeOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Order**](Order.md)| order placed for purchasing the pet |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid Order | - |
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Tag.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Tag.md
new file mode 100644
index 000000000000..f24eba7d222e
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/Tag.md
@@ -0,0 +1,13 @@
+
+
+# Tag
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/TypeHolderDefault.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/TypeHolderDefault.md
new file mode 100644
index 000000000000..a338fc900cb1
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/TypeHolderDefault.md
@@ -0,0 +1,16 @@
+
+
+# TypeHolderDefault
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**stringItem** | **String** | |
+**numberItem** | [**BigDecimal**](BigDecimal.md) | |
+**integerItem** | **Integer** | |
+**boolItem** | **Boolean** | |
+**arrayItem** | **List<Integer>** | |
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/TypeHolderExample.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/TypeHolderExample.md
new file mode 100644
index 000000000000..f8858da60664
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/TypeHolderExample.md
@@ -0,0 +1,17 @@
+
+
+# TypeHolderExample
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**stringItem** | **String** | |
+**numberItem** | [**BigDecimal**](BigDecimal.md) | |
+**floatItem** | **Float** | |
+**integerItem** | **Integer** | |
+**boolItem** | **Boolean** | |
+**arrayItem** | **List<Integer>** | |
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/User.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/User.md
new file mode 100644
index 000000000000..c4ea94b7fc17
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/User.md
@@ -0,0 +1,19 @@
+
+
+# User
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**username** | **String** | | [optional]
+**firstName** | **String** | | [optional]
+**lastName** | **String** | | [optional]
+**email** | **String** | | [optional]
+**password** | **String** | | [optional]
+**phone** | **String** | | [optional]
+**userStatus** | **Integer** | User Status | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/UserApi.md
new file mode 100644
index 000000000000..7a90fb438b19
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/UserApi.md
@@ -0,0 +1,501 @@
+# UserApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**createUser**](UserApi.md#createUser) | **POST** /user | Create user
+[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
+[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
+[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
+[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
+[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
+[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
+[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
+
+
+
+# **createUser**
+> createUser(body)
+
+Create user
+
+This can only be done by the logged in user.
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ User body = new User(); // User | Created user object
+ try {
+ apiInstance.createUser(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**User**](User.md)| Created user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**0** | successful operation | - |
+
+
+# **createUsersWithArrayInput**
+> createUsersWithArrayInput(body)
+
+Creates list of users with given input array
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ List body = Arrays.asList(); // List | List of user object
+ try {
+ apiInstance.createUsersWithArrayInput(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**List<User>**](User.md)| List of user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**0** | successful operation | - |
+
+
+# **createUsersWithListInput**
+> createUsersWithListInput(body)
+
+Creates list of users with given input array
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ List body = Arrays.asList(); // List | List of user object
+ try {
+ apiInstance.createUsersWithListInput(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUsersWithListInput");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**List<User>**](User.md)| List of user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**0** | successful operation | - |
+
+
+# **deleteUser**
+> deleteUser(username)
+
+Delete user
+
+This can only be done by the logged in user.
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ String username = "username_example"; // String | The name that needs to be deleted
+ try {
+ apiInstance.deleteUser(username);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#deleteUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The name that needs to be deleted |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**400** | Invalid username supplied | - |
+**404** | User not found | - |
+
+
+# **getUserByName**
+> User getUserByName(username)
+
+Get user by user name
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
+ try {
+ User result = apiInstance.getUserByName(username);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#getUserByName");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The name that needs to be fetched. Use user1 for testing. |
+
+### Return type
+
+[**User**](User.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid username supplied | - |
+**404** | User not found | - |
+
+
+# **loginUser**
+> String loginUser(username, password)
+
+Logs user into the system
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ String username = "username_example"; // String | The user name for login
+ String password = "password_example"; // String | The password for login in clear text
+ try {
+ String result = apiInstance.loginUser(username, password);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#loginUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The user name for login |
+ **password** | **String**| The password for login in clear text |
+
+### Return type
+
+**String**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user * X-Expires-After - date in UTC when token expires |
+**400** | Invalid username/password supplied | - |
+
+
+# **logoutUser**
+> logoutUser()
+
+Logs out current logged in user session
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ try {
+ apiInstance.logoutUser();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#logoutUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**0** | successful operation | - |
+
+
+# **updateUser**
+> updateUser(username, body)
+
+Updated user
+
+This can only be done by the logged in user.
+
+### Example
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.models.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ String username = "username_example"; // String | name that need to be deleted
+ User body = new User(); // User | Updated user object
+ try {
+ apiInstance.updateUser(username, body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#updateUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| name that need to be deleted |
+ **body** | [**User**](User.md)| Updated user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**400** | Invalid user supplied | - |
+**404** | User not found | - |
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/XmlItem.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/XmlItem.md
new file mode 100644
index 000000000000..6065fd1f4e59
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/XmlItem.md
@@ -0,0 +1,40 @@
+
+
+# XmlItem
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**attributeString** | **String** | | [optional]
+**attributeNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
+**attributeInteger** | **Integer** | | [optional]
+**attributeBoolean** | **Boolean** | | [optional]
+**wrappedArray** | **List<Integer>** | | [optional]
+**nameString** | **String** | | [optional]
+**nameNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
+**nameInteger** | **Integer** | | [optional]
+**nameBoolean** | **Boolean** | | [optional]
+**nameArray** | **List<Integer>** | | [optional]
+**nameWrappedArray** | **List<Integer>** | | [optional]
+**prefixString** | **String** | | [optional]
+**prefixNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
+**prefixInteger** | **Integer** | | [optional]
+**prefixBoolean** | **Boolean** | | [optional]
+**prefixArray** | **List<Integer>** | | [optional]
+**prefixWrappedArray** | **List<Integer>** | | [optional]
+**namespaceString** | **String** | | [optional]
+**namespaceNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
+**namespaceInteger** | **Integer** | | [optional]
+**namespaceBoolean** | **Boolean** | | [optional]
+**namespaceArray** | **List<Integer>** | | [optional]
+**namespaceWrappedArray** | **List<Integer>** | | [optional]
+**prefixNsString** | **String** | | [optional]
+**prefixNsNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
+**prefixNsInteger** | **Integer** | | [optional]
+**prefixNsBoolean** | **Boolean** | | [optional]
+**prefixNsArray** | **List<Integer>** | | [optional]
+**prefixNsWrappedArray** | **List<Integer>** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/git_push.sh b/samples/client/petstore/java/okhttp-gson-dynamicOperations/git_push.sh
new file mode 100644
index 000000000000..ced3be2b0c7b
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/git_push.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+git_host=$4
+
+if [ "$git_host" = "" ]; then
+ git_host="github.com"
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
+fi
+
+if [ "$git_user_id" = "" ]; then
+ git_user_id="GIT_USER_ID"
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+ git_repo_id="GIT_REPO_ID"
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+ release_note="Minor update"
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=`git remote`
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+ if [ "$GIT_TOKEN" = "" ]; then
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
+ fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle.properties b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle.properties
new file mode 100644
index 000000000000..05644f0754af
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle.properties
@@ -0,0 +1,2 @@
+# Uncomment to build for Android
+#target = android
\ No newline at end of file
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 000000000000..cc4fdc293d0e
Binary files /dev/null and b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 000000000000..94920145f34e
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradlew b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradlew
new file mode 100644
index 000000000000..2fe81a7d95e4
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradlew
@@ -0,0 +1,183 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradlew.bat b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradlew.bat
new file mode 100644
index 000000000000..9618d8d9607c
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradlew.bat
@@ -0,0 +1,100 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml
new file mode 100644
index 000000000000..2be37fd6ee91
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml
@@ -0,0 +1,292 @@
+
+ 4.0.0
+ org.openapitools
+ petstore-okhttp-gson-dynamicoperations
+ jar
+ petstore-okhttp-gson-dynamicoperations
+ 1.0.0
+ https://github.com/openapitools/openapi-generator
+ OpenAPI Java
+
+ scm:git:git@github.com:openapitools/openapi-generator.git
+ scm:git:git@github.com:openapitools/openapi-generator.git
+ https://github.com/openapitools/openapi-generator
+
+
+
+
+ Unlicense
+ https://www.apache.org/licenses/LICENSE-2.0.html
+ repo
+
+
+
+
+
+ OpenAPI-Generator Contributors
+ team@openapitools.org
+ OpenAPITools.org
+ http://openapitools.org
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.8.1
+
+ true
+ 128m
+ 512m
+
+ -Xlint:all
+ -J-Xss4m
+
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ 3.0.0-M1
+
+
+ enforce-maven
+
+ enforce
+
+
+
+
+ 2.2.0
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 3.0.0-M4
+
+
+
+ loggerPath
+ conf/log4j.properties
+
+
+ -Xms512m -Xmx1500m
+ methods
+ 10
+
+
+
+ maven-dependency-plugin
+
+
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}/lib
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 2.2
+
+
+
+ jar
+ test-jar
+
+
+
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+ 1.10
+
+
+ add_sources
+ generate-sources
+
+ add-source
+
+
+
+
+
+
+
+
+ add_test_sources
+ generate-test-sources
+
+ add-test-source
+
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.1.1
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+ none
+
+
+ http.response.details
+ a
+ Http Response Details:
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 2.2.1
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+
+
+
+
+ sign-artifacts
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 1.5
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+
+
+
+
+
+
+ io.swagger
+ swagger-annotations
+ ${swagger-core-version}
+
+
+
+ com.google.code.findbugs
+ jsr305
+ 3.0.2
+
+
+ com.squareup.okhttp3
+ okhttp
+ ${okhttp-version}
+
+
+ com.squareup.okhttp3
+ logging-interceptor
+ ${okhttp-version}
+
+
+ com.google.code.gson
+ gson
+ ${gson-version}
+
+
+ io.gsonfire
+ gson-fire
+ ${gson-fire-version}
+
+
+ org.apache.oltu.oauth2
+ org.apache.oltu.oauth2.client
+ 1.0.1
+
+
+ org.apache.commons
+ commons-lang3
+ ${commons-lang3-version}
+
+
+ org.threeten
+ threetenbp
+ ${threetenbp-version}
+
+
+ io.swagger.parser.v3
+ swagger-parser-v3
+ 2.0.23
+
+
+ javax.annotation
+ javax.annotation-api
+ ${javax-annotation-version}
+ provided
+
+
+
+ junit
+ junit
+ ${junit-version}
+ test
+
+
+
+ 1.7
+ ${java.version}
+ ${java.version}
+ 1.8.4
+ 1.5.24
+ 3.14.7
+ 2.8.6
+ 3.10
+ 1.4.3
+ 1.3.2
+ 4.13.1
+ UTF-8
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/settings.gradle b/samples/client/petstore/java/okhttp-gson-dynamicOperations/settings.gradle
new file mode 100644
index 000000000000..46b668c1e874
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = "petstore-okhttp-gson-dynamicoperations"
\ No newline at end of file
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/AndroidManifest.xml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/AndroidManifest.xml
new file mode 100644
index 000000000000..54fbcb3da1e8
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/AndroidManifest.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiCallback.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiCallback.java
new file mode 100644
index 000000000000..c10438d3c5b6
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiCallback.java
@@ -0,0 +1,62 @@
+/*
+ * OpenAPI 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: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client;
+
+import java.io.IOException;
+
+import java.util.Map;
+import java.util.List;
+
+/**
+ * Callback for asynchronous API call.
+ *
+ * @param The return type
+ */
+public interface ApiCallback {
+ /**
+ * This is called when the API call fails.
+ *
+ * @param e The exception causing the failure
+ * @param statusCode Status code of the response if available, otherwise it would be 0
+ * @param responseHeaders Headers of the response if available, otherwise it would be null
+ */
+ void onFailure(ApiException e, int statusCode, Map> responseHeaders);
+
+ /**
+ * This is called when the API call succeeded.
+ *
+ * @param result The result deserialized from response
+ * @param statusCode Status code of the response
+ * @param responseHeaders Headers of the response
+ */
+ void onSuccess(T result, int statusCode, Map> responseHeaders);
+
+ /**
+ * This is called when the API upload processing.
+ *
+ * @param bytesWritten bytes Written
+ * @param contentLength content length of request body
+ * @param done write end
+ */
+ void onUploadProgress(long bytesWritten, long contentLength, boolean done);
+
+ /**
+ * This is called when the API downlond processing.
+ *
+ * @param bytesRead bytes Read
+ * @param contentLength content lenngth of the response
+ * @param done Read end
+ */
+ void onDownloadProgress(long bytesRead, long contentLength, boolean done);
+}
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
new file mode 100644
index 000000000000..1fdd561fbeed
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
@@ -0,0 +1,1503 @@
+/*
+ * OpenAPI 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: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client;
+
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.Operation;
+import io.swagger.v3.oas.models.PathItem;
+import io.swagger.v3.oas.models.parameters.Parameter;
+import io.swagger.v3.oas.models.parameters.Parameter.StyleEnum;
+import io.swagger.v3.parser.OpenAPIV3Parser;
+import okhttp3.*;
+import okhttp3.internal.http.HttpMethod;
+import okhttp3.internal.tls.OkHostnameVerifier;
+import okhttp3.logging.HttpLoggingInterceptor;
+import okhttp3.logging.HttpLoggingInterceptor.Level;
+import okio.BufferedSink;
+import okio.Okio;
+import org.threeten.bp.LocalDate;
+import org.threeten.bp.OffsetDateTime;
+import org.threeten.bp.format.DateTimeFormatter;
+import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder;
+import org.apache.oltu.oauth2.common.message.types.GrantType;
+
+import javax.net.ssl.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Type;
+import java.net.URI;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import java.security.GeneralSecurityException;
+import java.security.KeyStore;
+import java.security.SecureRandom;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.text.DateFormat;
+import java.util.*;
+import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.openapitools.client.auth.Authentication;
+import org.openapitools.client.auth.HttpBasicAuth;
+import org.openapitools.client.auth.HttpBearerAuth;
+import org.openapitools.client.auth.ApiKeyAuth;
+import org.openapitools.client.auth.OAuth;
+import org.openapitools.client.auth.RetryingOAuth;
+import org.openapitools.client.auth.OAuthFlow;
+
+public class ApiClient {
+
+ private String basePath = "http://petstore.swagger.io:80/v2";
+ private boolean debugging = false;
+ private Map defaultHeaderMap = new HashMap();
+ private Map defaultCookieMap = new HashMap();
+ private String tempFolderPath = null;
+
+ private Map authentications;
+
+ private DateFormat dateFormat;
+ private DateFormat datetimeFormat;
+ private boolean lenientDatetimeFormat;
+ private int dateLength;
+
+ private InputStream sslCaCert;
+ private boolean verifyingSsl;
+ private KeyManager[] keyManagers;
+
+ private OkHttpClient httpClient;
+ private JSON json;
+
+ private HttpLoggingInterceptor loggingInterceptor;
+
+ private Map operationLookupMap = new HashMap<>();
+
+ /*
+ * Basic constructor for ApiClient
+ */
+ public ApiClient() {
+ init();
+ initHttpClient();
+
+ // Setup authentications (key: authentication name, value: authentication).
+ authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
+ authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
+ authentications.put("http_basic_test", new HttpBasicAuth());
+ authentications.put("petstore_auth", new OAuth());
+ // Prevent the authentications from being modified.
+ authentications = Collections.unmodifiableMap(authentications);
+ }
+
+ /*
+ * Basic constructor with custom OkHttpClient
+ */
+ public ApiClient(OkHttpClient client) {
+ init();
+
+ httpClient = client;
+
+ // Setup authentications (key: authentication name, value: authentication).
+ authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
+ authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
+ authentications.put("http_basic_test", new HttpBasicAuth());
+ authentications.put("petstore_auth", new OAuth());
+ // Prevent the authentications from being modified.
+ authentications = Collections.unmodifiableMap(authentications);
+ }
+
+ /*
+ * Constructor for ApiClient to support access token retry on 401/403 configured with client ID
+ */
+ public ApiClient(String clientId) {
+ this(clientId, null, null);
+ }
+
+ /*
+ * Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters
+ */
+ public ApiClient(String clientId, Map parameters) {
+ this(clientId, null, parameters);
+ }
+
+ /*
+ * Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters
+ */
+ public ApiClient(String clientId, String clientSecret, Map parameters) {
+ this(null, clientId, clientSecret, parameters);
+ }
+
+ /*
+ * Constructor for ApiClient to support access token retry on 401/403 configured with base path, client ID, secret, and additional parameters
+ */
+ public ApiClient(String basePath, String clientId, String clientSecret, Map parameters) {
+ init();
+ if (basePath != null) {
+ this.basePath = basePath;
+ }
+
+ String tokenUrl = "";
+ if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) {
+ URI uri = URI.create(getBasePath());
+ tokenUrl = uri.getScheme() + ":" +
+ (uri.getAuthority() != null ? "//" + uri.getAuthority() : "") +
+ tokenUrl;
+ if (!URI.create(tokenUrl).isAbsolute()) {
+ throw new IllegalArgumentException("OAuth2 token URL must be an absolute URL");
+ }
+ }
+ RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.implicit, clientSecret, parameters);
+ authentications.put(
+ "petstore_auth",
+ retryingOAuth
+ );
+ initHttpClient(Collections.singletonList(retryingOAuth));
+ // Setup authentications (key: authentication name, value: authentication).
+ authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
+ authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
+ authentications.put("http_basic_test", new HttpBasicAuth());
+
+ // Prevent the authentications from being modified.
+ authentications = Collections.unmodifiableMap(authentications);
+ }
+
+ private void initHttpClient() {
+ initHttpClient(Collections.emptyList());
+ }
+
+ private void initHttpClient(List interceptors) {
+ OkHttpClient.Builder builder = new OkHttpClient.Builder();
+ builder.addNetworkInterceptor(getProgressInterceptor());
+ for (Interceptor interceptor: interceptors) {
+ builder.addInterceptor(interceptor);
+ }
+
+ httpClient = builder.build();
+ }
+
+ private void init() {
+ verifyingSsl = true;
+
+ json = new JSON();
+
+ // Set default User-Agent.
+ setUserAgent("OpenAPI-Generator/1.0.0/java");
+
+ authentications = new HashMap();
+
+ OpenAPI openAPI = new OpenAPIV3Parser().read("openapi/openapi.yaml");
+ createOperationLookupMap(openAPI);
+ }
+
+ /**
+ * Get base path
+ *
+ * @return Base path
+ */
+ public String getBasePath() {
+ return basePath;
+ }
+
+ /**
+ * Set base path
+ *
+ * @param basePath Base path of the URL (e.g http://petstore.swagger.io:80/v2
+ * @return An instance of OkHttpClient
+ */
+ public ApiClient setBasePath(String basePath) {
+ this.basePath = basePath;
+ return this;
+ }
+
+ /**
+ * Get HTTP client
+ *
+ * @return An instance of OkHttpClient
+ */
+ public OkHttpClient getHttpClient() {
+ return httpClient;
+ }
+
+ /**
+ * Set HTTP client, which must never be null.
+ *
+ * @param newHttpClient An instance of OkHttpClient
+ * @return Api Client
+ * @throws NullPointerException when newHttpClient is null
+ */
+ public ApiClient setHttpClient(OkHttpClient newHttpClient) {
+ this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!");
+ return this;
+ }
+
+ /**
+ * Get JSON
+ *
+ * @return JSON object
+ */
+ public JSON getJSON() {
+ return json;
+ }
+
+ /**
+ * Set JSON
+ *
+ * @param json JSON object
+ * @return Api client
+ */
+ public ApiClient setJSON(JSON json) {
+ this.json = json;
+ return this;
+ }
+
+ /**
+ * True if isVerifyingSsl flag is on
+ *
+ * @return True if isVerifySsl flag is on
+ */
+ public boolean isVerifyingSsl() {
+ return verifyingSsl;
+ }
+
+ /**
+ * Configure whether to verify certificate and hostname when making https requests.
+ * Default to true.
+ * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks.
+ *
+ * @param verifyingSsl True to verify TLS/SSL connection
+ * @return ApiClient
+ */
+ public ApiClient setVerifyingSsl(boolean verifyingSsl) {
+ this.verifyingSsl = verifyingSsl;
+ applySslSettings();
+ return this;
+ }
+
+ /**
+ * Get SSL CA cert.
+ *
+ * @return Input stream to the SSL CA cert
+ */
+ public InputStream getSslCaCert() {
+ return sslCaCert;
+ }
+
+ /**
+ * Configure the CA certificate to be trusted when making https requests.
+ * Use null to reset to default.
+ *
+ * @param sslCaCert input stream for SSL CA cert
+ * @return ApiClient
+ */
+ public ApiClient setSslCaCert(InputStream sslCaCert) {
+ this.sslCaCert = sslCaCert;
+ applySslSettings();
+ return this;
+ }
+
+ public KeyManager[] getKeyManagers() {
+ return keyManagers;
+ }
+
+ /**
+ * Configure client keys to use for authorization in an SSL session.
+ * Use null to reset to default.
+ *
+ * @param managers The KeyManagers to use
+ * @return ApiClient
+ */
+ public ApiClient setKeyManagers(KeyManager[] managers) {
+ this.keyManagers = managers;
+ applySslSettings();
+ return this;
+ }
+
+ public DateFormat getDateFormat() {
+ return dateFormat;
+ }
+
+ public ApiClient setDateFormat(DateFormat dateFormat) {
+ this.json.setDateFormat(dateFormat);
+ return this;
+ }
+
+ public ApiClient setSqlDateFormat(DateFormat dateFormat) {
+ this.json.setSqlDateFormat(dateFormat);
+ return this;
+ }
+
+ public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
+ this.json.setOffsetDateTimeFormat(dateFormat);
+ return this;
+ }
+
+ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
+ this.json.setLocalDateFormat(dateFormat);
+ return this;
+ }
+
+ public ApiClient setLenientOnJson(boolean lenientOnJson) {
+ this.json.setLenientOnJson(lenientOnJson);
+ return this;
+ }
+
+ /**
+ * Get authentications (key: authentication name, value: authentication).
+ *
+ * @return Map of authentication objects
+ */
+ public Map getAuthentications() {
+ return authentications;
+ }
+
+ /**
+ * Get authentication for the given name.
+ *
+ * @param authName The authentication name
+ * @return The authentication, null if not found
+ */
+ public Authentication getAuthentication(String authName) {
+ return authentications.get(authName);
+ }
+
+ /**
+ * Helper method to set username for the first HTTP basic authentication.
+ *
+ * @param username Username
+ */
+ public void setUsername(String username) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBasicAuth) {
+ ((HttpBasicAuth) auth).setUsername(username);
+ return;
+ }
+ }
+ throw new RuntimeException("No HTTP basic authentication configured!");
+ }
+
+ /**
+ * Helper method to set password for the first HTTP basic authentication.
+ *
+ * @param password Password
+ */
+ public void setPassword(String password) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBasicAuth) {
+ ((HttpBasicAuth) auth).setPassword(password);
+ return;
+ }
+ }
+ throw new RuntimeException("No HTTP basic authentication configured!");
+ }
+
+ /**
+ * Helper method to set API key value for the first API key authentication.
+ *
+ * @param apiKey API key
+ */
+ public void setApiKey(String apiKey) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof ApiKeyAuth) {
+ ((ApiKeyAuth) auth).setApiKey(apiKey);
+ return;
+ }
+ }
+ throw new RuntimeException("No API key authentication configured!");
+ }
+
+ /**
+ * Helper method to set API key prefix for the first API key authentication.
+ *
+ * @param apiKeyPrefix API key prefix
+ */
+ public void setApiKeyPrefix(String apiKeyPrefix) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof ApiKeyAuth) {
+ ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
+ return;
+ }
+ }
+ throw new RuntimeException("No API key authentication configured!");
+ }
+
+ /**
+ * Helper method to set access token for the first OAuth2 authentication.
+ *
+ * @param accessToken Access token
+ */
+ public void setAccessToken(String accessToken) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ ((OAuth) auth).setAccessToken(accessToken);
+ return;
+ }
+ }
+ throw new RuntimeException("No OAuth2 authentication configured!");
+ }
+
+ /**
+ * Set the User-Agent header's value (by adding to the default header map).
+ *
+ * @param userAgent HTTP request's user agent
+ * @return ApiClient
+ */
+ public ApiClient setUserAgent(String userAgent) {
+ addDefaultHeader("User-Agent", userAgent);
+ return this;
+ }
+
+ /**
+ * Add a default header.
+ *
+ * @param key The header's key
+ * @param value The header's value
+ * @return ApiClient
+ */
+ public ApiClient addDefaultHeader(String key, String value) {
+ defaultHeaderMap.put(key, value);
+ return this;
+ }
+
+ /**
+ * Add a default cookie.
+ *
+ * @param key The cookie's key
+ * @param value The cookie's value
+ * @return ApiClient
+ */
+ public ApiClient addDefaultCookie(String key, String value) {
+ defaultCookieMap.put(key, value);
+ return this;
+ }
+
+ /**
+ * Check that whether debugging is enabled for this API client.
+ *
+ * @return True if debugging is enabled, false otherwise.
+ */
+ public boolean isDebugging() {
+ return debugging;
+ }
+
+ /**
+ * Enable/disable debugging for this API client.
+ *
+ * @param debugging To enable (true) or disable (false) debugging
+ * @return ApiClient
+ */
+ public ApiClient setDebugging(boolean debugging) {
+ if (debugging != this.debugging) {
+ if (debugging) {
+ loggingInterceptor = new HttpLoggingInterceptor();
+ loggingInterceptor.setLevel(Level.BODY);
+ httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build();
+ } else {
+ final OkHttpClient.Builder builder = httpClient.newBuilder();
+ builder.interceptors().remove(loggingInterceptor);
+ httpClient = builder.build();
+ loggingInterceptor = null;
+ }
+ }
+ this.debugging = debugging;
+ return this;
+ }
+
+ /**
+ * The path of temporary folder used to store downloaded files from endpoints
+ * with file response. The default value is null, i.e. using
+ * the system's default tempopary folder.
+ *
+ * @see createTempFile
+ * @return Temporary folder path
+ */
+ public String getTempFolderPath() {
+ return tempFolderPath;
+ }
+
+ /**
+ * Set the temporary folder path (for downloading files)
+ *
+ * @param tempFolderPath Temporary folder path
+ * @return ApiClient
+ */
+ public ApiClient setTempFolderPath(String tempFolderPath) {
+ this.tempFolderPath = tempFolderPath;
+ return this;
+ }
+
+ /**
+ * Get connection timeout (in milliseconds).
+ *
+ * @return Timeout in milliseconds
+ */
+ public int getConnectTimeout() {
+ return httpClient.connectTimeoutMillis();
+ }
+
+ /**
+ * Sets the connect timeout (in milliseconds).
+ * A value of 0 means no timeout, otherwise values must be between 1 and
+ * {@link Integer#MAX_VALUE}.
+ *
+ * @param connectionTimeout connection timeout in milliseconds
+ * @return Api client
+ */
+ public ApiClient setConnectTimeout(int connectionTimeout) {
+ httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build();
+ return this;
+ }
+
+ /**
+ * Get read timeout (in milliseconds).
+ *
+ * @return Timeout in milliseconds
+ */
+ public int getReadTimeout() {
+ return httpClient.readTimeoutMillis();
+ }
+
+ /**
+ * Sets the read timeout (in milliseconds).
+ * A value of 0 means no timeout, otherwise values must be between 1 and
+ * {@link Integer#MAX_VALUE}.
+ *
+ * @param readTimeout read timeout in milliseconds
+ * @return Api client
+ */
+ public ApiClient setReadTimeout(int readTimeout) {
+ httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build();
+ return this;
+ }
+
+ /**
+ * Get write timeout (in milliseconds).
+ *
+ * @return Timeout in milliseconds
+ */
+ public int getWriteTimeout() {
+ return httpClient.writeTimeoutMillis();
+ }
+
+ /**
+ * Sets the write timeout (in milliseconds).
+ * A value of 0 means no timeout, otherwise values must be between 1 and
+ * {@link Integer#MAX_VALUE}.
+ *
+ * @param writeTimeout connection timeout in milliseconds
+ * @return Api client
+ */
+ public ApiClient setWriteTimeout(int writeTimeout) {
+ httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build();
+ return this;
+ }
+
+ /**
+ * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one)
+ *
+ * @return Token request builder
+ */
+ public TokenRequestBuilder getTokenEndPoint() {
+ for (Authentication apiAuth : authentications.values()) {
+ if (apiAuth instanceof RetryingOAuth) {
+ RetryingOAuth retryingOAuth = (RetryingOAuth) apiAuth;
+ return retryingOAuth.getTokenRequestBuilder();
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Format the given parameter object into string.
+ *
+ * @param param Parameter
+ * @return String representation of the parameter
+ */
+ public String parameterToString(Object param) {
+ if (param == null) {
+ return "";
+ } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) {
+ //Serialize to json string and remove the " enclosing characters
+ String jsonStr = json.serialize(param);
+ return jsonStr.substring(1, jsonStr.length() - 1);
+ } else if (param instanceof Collection) {
+ StringBuilder b = new StringBuilder();
+ for (Object o : (Collection) param) {
+ if (b.length() > 0) {
+ b.append(",");
+ }
+ b.append(String.valueOf(o));
+ }
+ return b.toString();
+ } else {
+ return String.valueOf(param);
+ }
+ }
+
+ /**
+ * Formats the specified query parameter to a list containing a single {@code Pair} object.
+ *
+ * Note that {@code value} must not be a collection.
+ *
+ * @param name The name of the parameter.
+ * @param value The value of the parameter.
+ * @return A list containing a single {@code Pair} object.
+ */
+ public List parameterToPair(String name, Object value) {
+ List params = new ArrayList();
+
+ // preconditions
+ if (name == null || name.isEmpty() || value == null || value instanceof Collection) {
+ return params;
+ }
+
+ params.add(new Pair(name, parameterToString(value)));
+ return params;
+ }
+
+ public List parameterToPairs(Parameter param, Collection value) {
+ List params = new ArrayList();
+
+ // preconditions
+ if (param == null || param.getName() == null || param.getName().isEmpty() || value == null) {
+ return params;
+ }
+
+ // create the params based on the collection format
+ if (StyleEnum.FORM.equals(param.getStyle()) && Boolean.TRUE.equals(param.getExplode())) {
+ for (Object item : value) {
+ params.add(new Pair(param.getName(), escapeString(parameterToString(item))));
+ }
+ return params;
+ }
+
+ // collectionFormat is assumed to be "csv" by default
+ String delimiter = ",";
+
+ // escape all delimiters except commas, which are URI reserved
+ // characters
+ if (StyleEnum.SPACEDELIMITED.equals(param.getStyle())) {
+ delimiter = escapeString(" ");
+ } else if (StyleEnum.PIPEDELIMITED.equals(param.getStyle())) {
+ delimiter = escapeString("|");
+ }
+
+ StringBuilder sb = new StringBuilder();
+ for (Object item : value) {
+ sb.append(delimiter);
+ sb.append(escapeString(parameterToString(item)));
+ }
+
+ params.add(new Pair(param.getName(), sb.substring(delimiter.length())));
+
+ return params;
+ }
+
+ /**
+ * Formats the specified collection path parameter to a string value.
+ *
+ * @param collectionFormat The collection format of the parameter.
+ * @param value The value of the parameter.
+ * @return String representation of the parameter
+ */
+ public String collectionPathParameterToString(String collectionFormat, Collection value) {
+ // create the value based on the collection format
+ if ("multi".equals(collectionFormat)) {
+ // not valid for path params
+ return parameterToString(value);
+ }
+
+ // collectionFormat is assumed to be "csv" by default
+ String delimiter = ",";
+
+ if ("ssv".equals(collectionFormat)) {
+ delimiter = " ";
+ } else if ("tsv".equals(collectionFormat)) {
+ delimiter = "\t";
+ } else if ("pipes".equals(collectionFormat)) {
+ delimiter = "|";
+ }
+
+ StringBuilder sb = new StringBuilder() ;
+ for (Object item : value) {
+ sb.append(delimiter);
+ sb.append(parameterToString(item));
+ }
+
+ return sb.substring(delimiter.length());
+ }
+
+ /**
+ * Sanitize filename by removing path.
+ * e.g. ../../sun.gif becomes sun.gif
+ *
+ * @param filename The filename to be sanitized
+ * @return The sanitized filename
+ */
+ public String sanitizeFilename(String filename) {
+ return filename.replaceAll(".*[/\\\\]", "");
+ }
+
+ /**
+ * Check if the given MIME is a JSON MIME.
+ * JSON MIME examples:
+ * application/json
+ * application/json; charset=UTF8
+ * APPLICATION/JSON
+ * application/vnd.company+json
+ * "* / *" is also default to JSON
+ * @param mime MIME (Multipurpose Internet Mail Extensions)
+ * @return True if the given MIME is JSON, false otherwise.
+ */
+ public boolean isJsonMime(String mime) {
+ String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
+ return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
+ }
+
+ /**
+ * Select the Accept header's value from the given accepts array:
+ * if JSON exists in the given array, use it;
+ * otherwise use all of them (joining into a string)
+ *
+ * @param accepts The accepts array to select from
+ * @return The Accept header to use. If the given array is empty,
+ * null will be returned (not to set the Accept header explicitly).
+ */
+ public String selectHeaderAccept(String[] accepts) {
+ if (accepts.length == 0) {
+ return null;
+ }
+ for (String accept : accepts) {
+ if (isJsonMime(accept)) {
+ return accept;
+ }
+ }
+ return StringUtil.join(accepts, ",");
+ }
+
+ /**
+ * Select the Content-Type header's value from the given array:
+ * if JSON exists in the given array, use it;
+ * otherwise use the first one of the array.
+ *
+ * @param contentTypes The Content-Type array to select from
+ * @return The Content-Type header to use. If the given array is empty,
+ * or matches "any", JSON will be used.
+ */
+ public String selectHeaderContentType(String[] contentTypes) {
+ if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) {
+ return "application/json";
+ }
+ for (String contentType : contentTypes) {
+ if (isJsonMime(contentType)) {
+ return contentType;
+ }
+ }
+ return contentTypes[0];
+ }
+
+ /**
+ * Escape the given string to be used as URL query value.
+ *
+ * @param str String to be escaped
+ * @return Escaped string
+ */
+ public String escapeString(String str) {
+ try {
+ return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20");
+ } catch (UnsupportedEncodingException e) {
+ return str;
+ }
+ }
+
+ /**
+ * Deserialize response body to Java object, according to the return type and
+ * the Content-Type response header.
+ *
+ * @param Type
+ * @param response HTTP response
+ * @param returnType The type of the Java object
+ * @return The deserialized Java object
+ * @throws ApiException If fail to deserialize response body, i.e. cannot read response body
+ * or the Content-Type of the response is not supported.
+ */
+ @SuppressWarnings("unchecked")
+ public T deserialize(Response response, Type returnType) throws ApiException {
+ if (response == null || returnType == null) {
+ return null;
+ }
+
+ if ("byte[]".equals(returnType.toString())) {
+ // Handle binary response (byte array).
+ try {
+ return (T) response.body().bytes();
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ } else if (returnType.equals(File.class)) {
+ // Handle file downloading.
+ return (T) downloadFileFromResponse(response);
+ }
+
+ String respBody;
+ try {
+ if (response.body() != null)
+ respBody = response.body().string();
+ else
+ respBody = null;
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+
+ if (respBody == null || "".equals(respBody)) {
+ return null;
+ }
+
+ String contentType = response.headers().get("Content-Type");
+ if (contentType == null) {
+ // ensuring a default content type
+ contentType = "application/json";
+ }
+ if (isJsonMime(contentType)) {
+ return json.deserialize(respBody, returnType);
+ } else if (returnType.equals(String.class)) {
+ // Expecting string, return the raw response body.
+ return (T) respBody;
+ } else {
+ throw new ApiException(
+ "Content type \"" + contentType + "\" is not supported for type: " + returnType,
+ response.code(),
+ response.headers().toMultimap(),
+ respBody);
+ }
+ }
+
+ /**
+ * Serialize the given Java object into request body according to the object's
+ * class and the request Content-Type.
+ *
+ * @param obj The Java object
+ * @param contentType The request Content-Type
+ * @return The serialized request body
+ * @throws ApiException If fail to serialize the given object
+ */
+ public RequestBody serialize(Object obj, String contentType) throws ApiException {
+ if (obj instanceof byte[]) {
+ // Binary (byte array) body parameter support.
+ return RequestBody.create(MediaType.parse(contentType), (byte[]) obj);
+ } else if (obj instanceof File) {
+ // File body parameter support.
+ return RequestBody.create(MediaType.parse(contentType), (File) obj);
+ } else if (isJsonMime(contentType)) {
+ String content;
+ if (obj != null) {
+ content = json.serialize(obj);
+ } else {
+ content = null;
+ }
+ return RequestBody.create(MediaType.parse(contentType), content);
+ } else {
+ throw new ApiException("Content type \"" + contentType + "\" is not supported");
+ }
+ }
+
+ /**
+ * Download file from the given response.
+ *
+ * @param response An instance of the Response object
+ * @throws ApiException If fail to read file content from response and write to disk
+ * @return Downloaded file
+ */
+ public File downloadFileFromResponse(Response response) throws ApiException {
+ try {
+ File file = prepareDownloadFile(response);
+ BufferedSink sink = Okio.buffer(Okio.sink(file));
+ sink.writeAll(response.body().source());
+ sink.close();
+ return file;
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ }
+
+ /**
+ * Prepare file for download
+ *
+ * @param response An instance of the Response object
+ * @return Prepared file for the download
+ * @throws IOException If fail to prepare file for download
+ */
+ public File prepareDownloadFile(Response response) throws IOException {
+ String filename = null;
+ String contentDisposition = response.header("Content-Disposition");
+ if (contentDisposition != null && !"".equals(contentDisposition)) {
+ // Get filename from the Content-Disposition header.
+ Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
+ Matcher matcher = pattern.matcher(contentDisposition);
+ if (matcher.find()) {
+ filename = sanitizeFilename(matcher.group(1));
+ }
+ }
+
+ String prefix = null;
+ String suffix = null;
+ if (filename == null) {
+ prefix = "download-";
+ suffix = "";
+ } else {
+ int pos = filename.lastIndexOf(".");
+ if (pos == -1) {
+ prefix = filename + "-";
+ } else {
+ prefix = filename.substring(0, pos) + "-";
+ suffix = filename.substring(pos);
+ }
+ // File.createTempFile requires the prefix to be at least three characters long
+ if (prefix.length() < 3)
+ prefix = "download-";
+ }
+
+ if (tempFolderPath == null)
+ return File.createTempFile(prefix, suffix);
+ else
+ return File.createTempFile(prefix, suffix, new File(tempFolderPath));
+ }
+
+ /**
+ * {@link #execute(Call, Type)}
+ *
+ * @param Type
+ * @param call An instance of the Call object
+ * @return ApiResponse<T>
+ * @throws ApiException If fail to execute the call
+ */
+ public ApiResponse execute(Call call) throws ApiException {
+ return execute(call, null);
+ }
+
+ /**
+ * Execute HTTP call and deserialize the HTTP response body into the given return type.
+ *
+ * @param returnType The return type used to deserialize HTTP response body
+ * @param The return type corresponding to (same with) returnType
+ * @param call Call
+ * @return ApiResponse object containing response status, headers and
+ * data, which is a Java object deserialized from response body and would be null
+ * when returnType is null.
+ * @throws ApiException If fail to execute the call
+ */
+ public ApiResponse execute(Call call, Type returnType) throws ApiException {
+ try {
+ Response response = call.execute();
+ T data = handleResponse(response, returnType);
+ return new ApiResponse(response.code(), response.headers().toMultimap(), data);
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ }
+
+ /**
+ * {@link #executeAsync(Call, Type, ApiCallback)}
+ *
+ * @param Type
+ * @param call An instance of the Call object
+ * @param callback ApiCallback<T>
+ */
+ public void executeAsync(Call call, ApiCallback callback) {
+ executeAsync(call, null, callback);
+ }
+
+ /**
+ * Execute HTTP call asynchronously.
+ *
+ * @param Type
+ * @param call The callback to be executed when the API call finishes
+ * @param returnType Return type
+ * @param callback ApiCallback
+ * @see #execute(Call, Type)
+ */
+ @SuppressWarnings("unchecked")
+ public void executeAsync(Call call, final Type returnType, final ApiCallback callback) {
+ call.enqueue(new Callback() {
+ @Override
+ public void onFailure(Call call, IOException e) {
+ callback.onFailure(new ApiException(e), 0, null);
+ }
+
+ @Override
+ public void onResponse(Call call, Response response) throws IOException {
+ T result;
+ try {
+ result = (T) handleResponse(response, returnType);
+ } catch (ApiException e) {
+ callback.onFailure(e, response.code(), response.headers().toMultimap());
+ return;
+ } catch (Exception e) {
+ callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap());
+ return;
+ }
+ callback.onSuccess(result, response.code(), response.headers().toMultimap());
+ }
+ });
+ }
+
+ /**
+ * Handle the given response, return the deserialized object when the response is successful.
+ *
+ * @param Type
+ * @param response Response
+ * @param returnType Return type
+ * @return Type
+ * @throws ApiException If the response has an unsuccessful status code or
+ * fail to deserialize the response body
+ */
+ public T handleResponse(Response response, Type returnType) throws ApiException {
+ if (response.isSuccessful()) {
+ if (returnType == null || response.code() == 204) {
+ // returning null if the returnType is not defined,
+ // or the status code is 204 (No Content)
+ if (response.body() != null) {
+ try {
+ response.body().close();
+ } catch (Exception e) {
+ throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap());
+ }
+ }
+ return null;
+ } else {
+ return deserialize(response, returnType);
+ }
+ } else {
+ String respBody = null;
+ if (response.body() != null) {
+ try {
+ respBody = response.body().string();
+ } catch (IOException e) {
+ throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap());
+ }
+ }
+ throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody);
+ }
+ }
+
+ /**
+ * Build HTTP call with the given options.
+ *
+ * @param path The sub-path of the HTTP URL
+ * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
+ * @param queryParams The query parameters
+ * @param collectionQueryParams The collection query parameters
+ * @param body The request body object
+ * @param headerParams The header parameters
+ * @param cookieParams The cookie parameters
+ * @param formParams The form parameters
+ * @param authNames The authentications to apply
+ * @param callback Callback for upload/download progress
+ * @return The HTTP call
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException {
+ Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback);
+
+ return httpClient.newCall(request);
+ }
+
+ /**
+ * Build an HTTP request with the given options.
+ *
+ * @param path The sub-path of the HTTP URL
+ * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
+ * @param queryParams The query parameters
+ * @param collectionQueryParams The collection query parameters
+ * @param body The request body object
+ * @param headerParams The header parameters
+ * @param cookieParams The cookie parameters
+ * @param formParams The form parameters
+ * @param authNames The authentications to apply
+ * @param callback Callback for upload/download progress
+ * @return The HTTP request
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException {
+ updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
+
+ final String url = buildUrl(path, queryParams, collectionQueryParams);
+ final Request.Builder reqBuilder = new Request.Builder().url(url);
+ processHeaderParams(headerParams, reqBuilder);
+ processCookieParams(cookieParams, reqBuilder);
+
+ String contentType = (String) headerParams.get("Content-Type");
+ // ensuring a default content type
+ if (contentType == null) {
+ contentType = "application/json";
+ }
+
+ RequestBody reqBody;
+ if (!HttpMethod.permitsRequestBody(method)) {
+ reqBody = null;
+ } else if ("application/x-www-form-urlencoded".equals(contentType)) {
+ reqBody = buildRequestBodyFormEncoding(formParams);
+ } else if ("multipart/form-data".equals(contentType)) {
+ reqBody = buildRequestBodyMultipart(formParams);
+ } else if (body == null) {
+ if ("DELETE".equals(method)) {
+ // allow calling DELETE without sending a request body
+ reqBody = null;
+ } else {
+ // use an empty request body (for POST, PUT and PATCH)
+ reqBody = RequestBody.create(MediaType.parse(contentType), "");
+ }
+ } else {
+ reqBody = serialize(body, contentType);
+ }
+
+ // Associate callback with request (if not null) so interceptor can
+ // access it when creating ProgressResponseBody
+ reqBuilder.tag(callback);
+
+ Request request = null;
+
+ if (callback != null && reqBody != null) {
+ ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback);
+ request = reqBuilder.method(method, progressRequestBody).build();
+ } else {
+ request = reqBuilder.method(method, reqBody).build();
+ }
+
+ return request;
+ }
+
+ /**
+ * Build full URL by concatenating base path, the given sub path and query parameters.
+ *
+ * @param path The sub path
+ * @param queryParams The query parameters
+ * @param collectionQueryParams The collection query parameters
+ * @return The full URL
+ */
+ public String buildUrl(String path, List queryParams, List collectionQueryParams) {
+ final StringBuilder url = new StringBuilder();
+ url.append(basePath).append(path);
+
+ if (queryParams != null && !queryParams.isEmpty()) {
+ // support (constant) query string in `path`, e.g. "/posts?draft=1"
+ String prefix = path.contains("?") ? "&" : "?";
+ for (Pair param : queryParams) {
+ if (param.getValue() != null) {
+ if (prefix != null) {
+ url.append(prefix);
+ prefix = null;
+ } else {
+ url.append("&");
+ }
+ String value = parameterToString(param.getValue());
+ url.append(escapeString(param.getName())).append("=").append(escapeString(value));
+ }
+ }
+ }
+
+ if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) {
+ String prefix = url.toString().contains("?") ? "&" : "?";
+ for (Pair param : collectionQueryParams) {
+ if (param.getValue() != null) {
+ if (prefix != null) {
+ url.append(prefix);
+ prefix = null;
+ } else {
+ url.append("&");
+ }
+ String value = parameterToString(param.getValue());
+ // collection query parameter value already escaped as part of parameterToPairs
+ url.append(escapeString(param.getName())).append("=").append(value);
+ }
+ }
+ }
+
+ return url.toString();
+ }
+
+ /**
+ * Set header parameters to the request builder, including default headers.
+ *
+ * @param headerParams Header parameters in the form of Map
+ * @param reqBuilder Request.Builder
+ */
+ public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) {
+ for (Entry param : headerParams.entrySet()) {
+ reqBuilder.header(param.getKey(), parameterToString(param.getValue()));
+ }
+ for (Entry header : defaultHeaderMap.entrySet()) {
+ if (!headerParams.containsKey(header.getKey())) {
+ reqBuilder.header(header.getKey(), parameterToString(header.getValue()));
+ }
+ }
+ }
+
+ /**
+ * Set cookie parameters to the request builder, including default cookies.
+ *
+ * @param cookieParams Cookie parameters in the form of Map
+ * @param reqBuilder Request.Builder
+ */
+ public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) {
+ for (Entry param : cookieParams.entrySet()) {
+ reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue()));
+ }
+ for (Entry param : defaultCookieMap.entrySet()) {
+ if (!cookieParams.containsKey(param.getKey())) {
+ reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue()));
+ }
+ }
+ }
+
+ /**
+ * Update query and header parameters based on authentication settings.
+ *
+ * @param authNames The authentications to apply
+ * @param queryParams List of query parameters
+ * @param headerParams Map of header parameters
+ * @param cookieParams Map of cookie parameters
+ */
+ public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) {
+ for (String authName : authNames) {
+ Authentication auth = authentications.get(authName);
+ if (auth == null) {
+ throw new RuntimeException("Authentication undefined: " + authName);
+ }
+ auth.applyToParams(queryParams, headerParams, cookieParams);
+ }
+ }
+
+ /**
+ * Build a form-encoding request body with the given form parameters.
+ *
+ * @param formParams Form parameters in the form of Map
+ * @return RequestBody
+ */
+ public RequestBody buildRequestBodyFormEncoding(Map formParams) {
+ okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder();
+ for (Entry param : formParams.entrySet()) {
+ formBuilder.add(param.getKey(), parameterToString(param.getValue()));
+ }
+ return formBuilder.build();
+ }
+
+ /**
+ * Build a multipart (file uploading) request body with the given form parameters,
+ * which could contain text fields and file fields.
+ *
+ * @param formParams Form parameters in the form of Map
+ * @return RequestBody
+ */
+ public RequestBody buildRequestBodyMultipart(Map formParams) {
+ MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM);
+ for (Entry param : formParams.entrySet()) {
+ if (param.getValue() instanceof File) {
+ File file = (File) param.getValue();
+ Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\"");
+ MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file));
+ mpBuilder.addPart(partHeaders, RequestBody.create(mediaType, file));
+ } else {
+ Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"");
+ mpBuilder.addPart(partHeaders, RequestBody.create(null, parameterToString(param.getValue())));
+ }
+ }
+ return mpBuilder.build();
+ }
+
+ /**
+ * Guess Content-Type header from the given file (defaults to "application/octet-stream").
+ *
+ * @param file The given file
+ * @return The guessed Content-Type
+ */
+ public String guessContentTypeFromFile(File file) {
+ String contentType = URLConnection.guessContentTypeFromName(file.getName());
+ if (contentType == null) {
+ return "application/octet-stream";
+ } else {
+ return contentType;
+ }
+ }
+
+ /**
+ * Get network interceptor to add it to the httpClient to track download progress for
+ * async requests.
+ */
+ private Interceptor getProgressInterceptor() {
+ return new Interceptor() {
+ @Override
+ public Response intercept(Interceptor.Chain chain) throws IOException {
+ final Request request = chain.request();
+ final Response originalResponse = chain.proceed(request);
+ if (request.tag() instanceof ApiCallback) {
+ final ApiCallback callback = (ApiCallback) request.tag();
+ return originalResponse.newBuilder()
+ .body(new ProgressResponseBody(originalResponse.body(), callback))
+ .build();
+ }
+ return originalResponse;
+ }
+ };
+ }
+
+ /**
+ * Apply SSL related settings to httpClient according to the current values of
+ * verifyingSsl and sslCaCert.
+ */
+ private void applySslSettings() {
+ try {
+ TrustManager[] trustManagers;
+ HostnameVerifier hostnameVerifier;
+ if (!verifyingSsl) {
+ trustManagers = new TrustManager[]{
+ new X509TrustManager() {
+ @Override
+ public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
+ }
+
+ @Override
+ public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
+ }
+
+ @Override
+ public java.security.cert.X509Certificate[] getAcceptedIssuers() {
+ return new java.security.cert.X509Certificate[]{};
+ }
+ }
+ };
+ hostnameVerifier = new HostnameVerifier() {
+ @Override
+ public boolean verify(String hostname, SSLSession session) {
+ return true;
+ }
+ };
+ } else {
+ TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+
+ if (sslCaCert == null) {
+ trustManagerFactory.init((KeyStore) null);
+ } else {
+ char[] password = null; // Any password will work.
+ CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
+ Collection extends Certificate> certificates = certificateFactory.generateCertificates(sslCaCert);
+ if (certificates.isEmpty()) {
+ throw new IllegalArgumentException("expected non-empty set of trusted certificates");
+ }
+ KeyStore caKeyStore = newEmptyKeyStore(password);
+ int index = 0;
+ for (Certificate certificate : certificates) {
+ String certificateAlias = "ca" + Integer.toString(index++);
+ caKeyStore.setCertificateEntry(certificateAlias, certificate);
+ }
+ trustManagerFactory.init(caKeyStore);
+ }
+ trustManagers = trustManagerFactory.getTrustManagers();
+ hostnameVerifier = OkHostnameVerifier.INSTANCE;
+ }
+
+ SSLContext sslContext = SSLContext.getInstance("TLS");
+ sslContext.init(keyManagers, trustManagers, new SecureRandom());
+ httpClient = httpClient.newBuilder()
+ .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0])
+ .hostnameVerifier(hostnameVerifier)
+ .build();
+ } catch (GeneralSecurityException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException {
+ try {
+ KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
+ keyStore.load(null, password);
+ return keyStore;
+ } catch (IOException e) {
+ throw new AssertionError(e);
+ }
+ }
+
+ public ApiClient createOperationLookupMap(OpenAPI openAPI) {
+ operationLookupMap = new HashMap<>();
+ for (Map.Entry pathItemEntry : openAPI.getPaths().entrySet()) {
+ String path = pathItemEntry.getKey();
+ PathItem pathItem = pathItemEntry.getValue();
+ addOperationLookupEntry(path, "GET", pathItem.getGet());
+ addOperationLookupEntry(path, "PUT", pathItem.getPut());
+ addOperationLookupEntry(path, "POST", pathItem.getPost());
+ addOperationLookupEntry(path, "DELETE", pathItem.getDelete());
+ addOperationLookupEntry(path, "OPTIONS", pathItem.getOptions());
+ addOperationLookupEntry(path, "HEAD", pathItem.getHead());
+ addOperationLookupEntry(path, "PATCH", pathItem.getPatch());
+ addOperationLookupEntry(path, "TRACE", pathItem.getTrace());
+ }
+ return this;
+ }
+
+ private void addOperationLookupEntry(String path, String method, Operation operation) {
+ if ( operation != null && operation.getOperationId() != null) {
+ operationLookupMap.put(
+ operation.getOperationId(),
+ new ApiOperation(path, method, operation));
+ }
+ }
+
+ public Map getOperationLookupMap() {
+ return operationLookupMap;
+ }
+
+ public String fillParametersFromOperation(
+ Operation operation,
+ Map paramMap,
+ String path,
+ List queryParams,
+ List collectionQueryParams,
+ Map headerParams,
+ Map cookieParams
+ ) {
+ for (Map.Entry entry : paramMap.entrySet()) {
+ Object value = entry.getValue();
+ for (Parameter param : operation.getParameters()) {
+ if (entry.getKey().equals(param.getName())) {
+ switch (param.getIn()) {
+ case "path":
+ path = path.replaceAll("\\{" + param.getName() + "\\}", escapeString(value.toString()));
+ break;
+ case "query":
+ if (value instanceof Collection>) {
+ collectionQueryParams.addAll(parameterToPairs(param, (Collection) value));
+ } else {
+ queryParams.addAll(parameterToPair(param.getName(), value));
+ }
+ break;
+ case "header":
+ headerParams.put(param.getName(), parameterToString(value));
+ break;
+ case "cookie":
+ cookieParams.put(param.getName(), parameterToString(value));
+ break;
+ default:
+ throw new IllegalStateException("Unexpected param in: " + param.getIn());
+ }
+
+ }
+ }
+ }
+ return path;
+ }
+}
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiException.java
new file mode 100644
index 000000000000..c814fc5bbc9c
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiException.java
@@ -0,0 +1,91 @@
+/*
+ * OpenAPI 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: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client;
+
+import java.util.Map;
+import java.util.List;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class ApiException extends Exception {
+ private int code = 0;
+ private Map> responseHeaders = null;
+ private String responseBody = null;
+
+ public ApiException() {}
+
+ public ApiException(Throwable throwable) {
+ super(throwable);
+ }
+
+ public ApiException(String message) {
+ super(message);
+ }
+
+ public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) {
+ super(message, throwable);
+ this.code = code;
+ this.responseHeaders = responseHeaders;
+ this.responseBody = responseBody;
+ }
+
+ public ApiException(String message, int code, Map> responseHeaders, String responseBody) {
+ this(message, (Throwable) null, code, responseHeaders, responseBody);
+ }
+
+ public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) {
+ this(message, throwable, code, responseHeaders, null);
+ }
+
+ public ApiException(int code, Map> responseHeaders, String responseBody) {
+ this((String) null, (Throwable) null, code, responseHeaders, responseBody);
+ }
+
+ public ApiException(int code, String message) {
+ super(message);
+ this.code = code;
+ }
+
+ public ApiException(int code, String message, Map> responseHeaders, String responseBody) {
+ this(code, message);
+ this.responseHeaders = responseHeaders;
+ this.responseBody = responseBody;
+ }
+
+ /**
+ * Get the HTTP status code.
+ *
+ * @return HTTP status code
+ */
+ public int getCode() {
+ return code;
+ }
+
+ /**
+ * Get the HTTP response headers.
+ *
+ * @return A map of list of string
+ */
+ public Map> getResponseHeaders() {
+ return responseHeaders;
+ }
+
+ /**
+ * Get the HTTP response body.
+ *
+ * @return Response body in the form of string
+ */
+ public String getResponseBody() {
+ return responseBody;
+ }
+}
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiOperation.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiOperation.java
new file mode 100644
index 000000000000..bd7670c17a0b
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiOperation.java
@@ -0,0 +1,39 @@
+/*
+ * OpenAPI 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: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package org.openapitools.client;
+
+import io.swagger.v3.oas.models.Operation;
+
+public class ApiOperation {
+ private final String path;
+ private final String method;
+ private final Operation operation;
+
+ public ApiOperation(String path, String method, Operation operation) {
+ this.path = path;
+ this.method = method;
+ this.operation = operation;
+ }
+
+ public Operation getOperation() {
+ return operation;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public String getMethod() {
+ return method;
+ }
+}
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiResponse.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiResponse.java
new file mode 100644
index 000000000000..9bb5cac17b41
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiResponse.java
@@ -0,0 +1,59 @@
+/*
+ * OpenAPI 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: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * API response returned by API call.
+ *
+ * @param The type of data that is deserialized from response body
+ */
+public class ApiResponse {
+ final private int statusCode;
+ final private Map> headers;
+ final private T data;
+
+ /**
+ * @param statusCode The status code of HTTP response
+ * @param headers The headers of HTTP response
+ */
+ public ApiResponse(int statusCode, Map> headers) {
+ this(statusCode, headers, null);
+ }
+
+ /**
+ * @param statusCode The status code of HTTP response
+ * @param headers The headers of HTTP response
+ * @param data The object deserialized from response bod
+ */
+ public ApiResponse(int statusCode, Map> headers, T data) {
+ this.statusCode = statusCode;
+ this.headers = headers;
+ this.data = data;
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public Map> getHeaders() {
+ return headers;
+ }
+
+ public T getData() {
+ return data;
+ }
+}
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/Configuration.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/Configuration.java
new file mode 100644
index 000000000000..476456fd4ed6
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/Configuration.java
@@ -0,0 +1,39 @@
+/*
+ * OpenAPI 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: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class Configuration {
+ private static ApiClient defaultApiClient = new ApiClient();
+
+ /**
+ * Get the default API client, which would be used when creating API
+ * instances without providing an API client.
+ *
+ * @return Default API client
+ */
+ public static ApiClient getDefaultApiClient() {
+ return defaultApiClient;
+ }
+
+ /**
+ * Set the default API client, which would be used when creating API
+ * instances without providing an API client.
+ *
+ * @param apiClient API client
+ */
+ public static void setDefaultApiClient(ApiClient apiClient) {
+ defaultApiClient = apiClient;
+ }
+}
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/GzipRequestInterceptor.java
new file mode 100644
index 000000000000..63442a34f40a
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/GzipRequestInterceptor.java
@@ -0,0 +1,85 @@
+/*
+ * OpenAPI 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: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client;
+
+import okhttp3.*;
+import okio.Buffer;
+import okio.BufferedSink;
+import okio.GzipSink;
+import okio.Okio;
+
+import java.io.IOException;
+
+/**
+ * Encodes request bodies using gzip.
+ *
+ * Taken from https://github.com/square/okhttp/issues/350
+ */
+class GzipRequestInterceptor implements Interceptor {
+ @Override
+ public Response intercept(Chain chain) throws IOException {
+ Request originalRequest = chain.request();
+ if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) {
+ return chain.proceed(originalRequest);
+ }
+
+ Request compressedRequest = originalRequest.newBuilder()
+ .header("Content-Encoding", "gzip")
+ .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body())))
+ .build();
+ return chain.proceed(compressedRequest);
+ }
+
+ private RequestBody forceContentLength(final RequestBody requestBody) throws IOException {
+ final Buffer buffer = new Buffer();
+ requestBody.writeTo(buffer);
+ return new RequestBody() {
+ @Override
+ public MediaType contentType() {
+ return requestBody.contentType();
+ }
+
+ @Override
+ public long contentLength() {
+ return buffer.size();
+ }
+
+ @Override
+ public void writeTo(BufferedSink sink) throws IOException {
+ sink.write(buffer.snapshot());
+ }
+ };
+ }
+
+ private RequestBody gzip(final RequestBody body) {
+ return new RequestBody() {
+ @Override
+ public MediaType contentType() {
+ return body.contentType();
+ }
+
+ @Override
+ public long contentLength() {
+ return -1; // We don't know the compressed length in advance!
+ }
+
+ @Override
+ public void writeTo(BufferedSink sink) throws IOException {
+ BufferedSink gzipSink = Okio.buffer(new GzipSink(sink));
+ body.writeTo(gzipSink);
+ gzipSink.close();
+ }
+ };
+ }
+}
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java
new file mode 100644
index 000000000000..08bf82ccae6f
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java
@@ -0,0 +1,442 @@
+/*
+ * OpenAPI 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: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonParseException;
+import com.google.gson.TypeAdapter;
+import com.google.gson.internal.bind.util.ISO8601Utils;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+import com.google.gson.JsonElement;
+import io.gsonfire.GsonFireBuilder;
+import io.gsonfire.TypeSelector;
+import org.threeten.bp.LocalDate;
+import org.threeten.bp.OffsetDateTime;
+import org.threeten.bp.format.DateTimeFormatter;
+
+import org.openapitools.client.model.*;
+import okio.ByteString;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.lang.reflect.Type;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.ParsePosition;
+import java.util.Date;
+import java.util.Locale;
+import java.util.Map;
+import java.util.HashMap;
+
+public class JSON {
+ private Gson gson;
+ private boolean isLenientOnJson = false;
+ private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter();
+ private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
+ private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
+ private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
+ private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
+
+ public static GsonBuilder createGson() {
+ GsonFireBuilder fireBuilder = new GsonFireBuilder()
+ .registerTypeSelector(Animal.class, new TypeSelector() {
+ @Override
+ public Class getClassForElement(JsonElement readElement) {
+ Map classByDiscriminatorValue = new HashMap();
+ classByDiscriminatorValue.put("BigCat", BigCat.class);
+ classByDiscriminatorValue.put("Cat", Cat.class);
+ classByDiscriminatorValue.put("Dog", Dog.class);
+ classByDiscriminatorValue.put("Animal", Animal.class);
+ return getClassByDiscriminator(classByDiscriminatorValue,
+ getDiscriminatorValue(readElement, "className"));
+ }
+ })
+ .registerTypeSelector(BigCat.class, new TypeSelector() {
+ @Override
+ public Class getClassForElement(JsonElement readElement) {
+ Map classByDiscriminatorValue = new HashMap();
+ classByDiscriminatorValue.put("BigCat", BigCat.class);
+ return getClassByDiscriminator(classByDiscriminatorValue,
+ getDiscriminatorValue(readElement, "className"));
+ }
+ })
+ .registerTypeSelector(Cat.class, new TypeSelector() {
+ @Override
+ public Class getClassForElement(JsonElement readElement) {
+ Map classByDiscriminatorValue = new HashMap();
+ classByDiscriminatorValue.put("BigCat", BigCat.class);
+ classByDiscriminatorValue.put("Cat", Cat.class);
+ return getClassByDiscriminator(classByDiscriminatorValue,
+ getDiscriminatorValue(readElement, "className"));
+ }
+ })
+ .registerTypeSelector(Dog.class, new TypeSelector() {
+ @Override
+ public Class getClassForElement(JsonElement readElement) {
+ Map classByDiscriminatorValue = new HashMap();
+ classByDiscriminatorValue.put("Dog", Dog.class);
+ return getClassByDiscriminator(classByDiscriminatorValue,
+ getDiscriminatorValue(readElement, "className"));
+ }
+ })
+ ;
+ GsonBuilder builder = fireBuilder.createGsonBuilder();
+ return builder;
+ }
+
+ private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) {
+ JsonElement element = readElement.getAsJsonObject().get(discriminatorField);
+ if (null == element) {
+ throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">");
+ }
+ return element.getAsString();
+ }
+
+ /**
+ * Returns the Java class that implements the OpenAPI schema for the specified discriminator value.
+ *
+ * @param classByDiscriminatorValue The map of discriminator values to Java classes.
+ * @param discriminatorValue The value of the OpenAPI discriminator in the input data.
+ * @return The Java class that implements the OpenAPI schema
+ */
+ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) {
+ Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue);
+ if (null == clazz) {
+ throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">");
+ }
+ return clazz;
+ }
+
+ public JSON() {
+ gson = createGson()
+ .registerTypeAdapter(Date.class, dateTypeAdapter)
+ .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter)
+ .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter)
+ .registerTypeAdapter(LocalDate.class, localDateTypeAdapter)
+ .registerTypeAdapter(byte[].class, byteArrayAdapter)
+ .create();
+ }
+
+ /**
+ * Get Gson.
+ *
+ * @return Gson
+ */
+ public Gson getGson() {
+ return gson;
+ }
+
+ /**
+ * Set Gson.
+ *
+ * @param gson Gson
+ * @return JSON
+ */
+ public JSON setGson(Gson gson) {
+ this.gson = gson;
+ return this;
+ }
+
+ public JSON setLenientOnJson(boolean lenientOnJson) {
+ isLenientOnJson = lenientOnJson;
+ return this;
+ }
+
+ /**
+ * Serialize the given Java object into JSON string.
+ *
+ * @param obj Object
+ * @return String representation of the JSON
+ */
+ public String serialize(Object obj) {
+ return gson.toJson(obj);
+ }
+
+ /**
+ * Deserialize the given JSON string to Java object.
+ *
+ * @param Type
+ * @param body The JSON string
+ * @param returnType The type to deserialize into
+ * @return The deserialized Java object
+ */
+ @SuppressWarnings("unchecked")
+ public T deserialize(String body, Type returnType) {
+ try {
+ if (isLenientOnJson) {
+ JsonReader jsonReader = new JsonReader(new StringReader(body));
+ // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
+ jsonReader.setLenient(true);
+ return gson.fromJson(jsonReader, returnType);
+ } else {
+ return gson.fromJson(body, returnType);
+ }
+ } catch (JsonParseException e) {
+ // Fallback processing when failed to parse JSON form response body:
+ // return the response body string directly for the String return type;
+ if (returnType.equals(String.class)) {
+ return (T) body;
+ } else {
+ throw (e);
+ }
+ }
+ }
+
+ /**
+ * Gson TypeAdapter for Byte Array type
+ */
+ public class ByteArrayAdapter extends TypeAdapter {
+
+ @Override
+ public void write(JsonWriter out, byte[] value) throws IOException {
+ if (value == null) {
+ out.nullValue();
+ } else {
+ out.value(ByteString.of(value).base64());
+ }
+ }
+
+ @Override
+ public byte[] read(JsonReader in) throws IOException {
+ switch (in.peek()) {
+ case NULL:
+ in.nextNull();
+ return null;
+ default:
+ String bytesAsBase64 = in.nextString();
+ ByteString byteString = ByteString.decodeBase64(bytesAsBase64);
+ return byteString.toByteArray();
+ }
+ }
+ }
+
+ /**
+ * Gson TypeAdapter for JSR310 OffsetDateTime type
+ */
+ public static class OffsetDateTimeTypeAdapter extends TypeAdapter {
+
+ private DateTimeFormatter formatter;
+
+ public OffsetDateTimeTypeAdapter() {
+ this(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
+ }
+
+ public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) {
+ this.formatter = formatter;
+ }
+
+ public void setFormat(DateTimeFormatter dateFormat) {
+ this.formatter = dateFormat;
+ }
+
+ @Override
+ public void write(JsonWriter out, OffsetDateTime date) throws IOException {
+ if (date == null) {
+ out.nullValue();
+ } else {
+ out.value(formatter.format(date));
+ }
+ }
+
+ @Override
+ public OffsetDateTime read(JsonReader in) throws IOException {
+ switch (in.peek()) {
+ case NULL:
+ in.nextNull();
+ return null;
+ default:
+ String date = in.nextString();
+ if (date.endsWith("+0000")) {
+ date = date.substring(0, date.length()-5) + "Z";
+ }
+ return OffsetDateTime.parse(date, formatter);
+ }
+ }
+ }
+
+ /**
+ * Gson TypeAdapter for JSR310 LocalDate type
+ */
+ public class LocalDateTypeAdapter extends TypeAdapter {
+
+ private DateTimeFormatter formatter;
+
+ public LocalDateTypeAdapter() {
+ this(DateTimeFormatter.ISO_LOCAL_DATE);
+ }
+
+ public LocalDateTypeAdapter(DateTimeFormatter formatter) {
+ this.formatter = formatter;
+ }
+
+ public void setFormat(DateTimeFormatter dateFormat) {
+ this.formatter = dateFormat;
+ }
+
+ @Override
+ public void write(JsonWriter out, LocalDate date) throws IOException {
+ if (date == null) {
+ out.nullValue();
+ } else {
+ out.value(formatter.format(date));
+ }
+ }
+
+ @Override
+ public LocalDate read(JsonReader in) throws IOException {
+ switch (in.peek()) {
+ case NULL:
+ in.nextNull();
+ return null;
+ default:
+ String date = in.nextString();
+ return LocalDate.parse(date, formatter);
+ }
+ }
+ }
+
+ public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
+ offsetDateTimeTypeAdapter.setFormat(dateFormat);
+ return this;
+ }
+
+ public JSON setLocalDateFormat(DateTimeFormatter dateFormat) {
+ localDateTypeAdapter.setFormat(dateFormat);
+ return this;
+ }
+
+ /**
+ * Gson TypeAdapter for java.sql.Date type
+ * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used
+ * (more efficient than SimpleDateFormat).
+ */
+ public static class SqlDateTypeAdapter extends TypeAdapter {
+
+ private DateFormat dateFormat;
+
+ public SqlDateTypeAdapter() {}
+
+ public SqlDateTypeAdapter(DateFormat dateFormat) {
+ this.dateFormat = dateFormat;
+ }
+
+ public void setFormat(DateFormat dateFormat) {
+ this.dateFormat = dateFormat;
+ }
+
+ @Override
+ public void write(JsonWriter out, java.sql.Date date) throws IOException {
+ if (date == null) {
+ out.nullValue();
+ } else {
+ String value;
+ if (dateFormat != null) {
+ value = dateFormat.format(date);
+ } else {
+ value = date.toString();
+ }
+ out.value(value);
+ }
+ }
+
+ @Override
+ public java.sql.Date read(JsonReader in) throws IOException {
+ switch (in.peek()) {
+ case NULL:
+ in.nextNull();
+ return null;
+ default:
+ String date = in.nextString();
+ try {
+ if (dateFormat != null) {
+ return new java.sql.Date(dateFormat.parse(date).getTime());
+ }
+ return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime());
+ } catch (ParseException e) {
+ throw new JsonParseException(e);
+ }
+ }
+ }
+ }
+
+ /**
+ * Gson TypeAdapter for java.util.Date type
+ * If the dateFormat is null, ISO8601Utils will be used.
+ */
+ public static class DateTypeAdapter extends TypeAdapter {
+
+ private DateFormat dateFormat;
+
+ public DateTypeAdapter() {}
+
+ public DateTypeAdapter(DateFormat dateFormat) {
+ this.dateFormat = dateFormat;
+ }
+
+ public void setFormat(DateFormat dateFormat) {
+ this.dateFormat = dateFormat;
+ }
+
+ @Override
+ public void write(JsonWriter out, Date date) throws IOException {
+ if (date == null) {
+ out.nullValue();
+ } else {
+ String value;
+ if (dateFormat != null) {
+ value = dateFormat.format(date);
+ } else {
+ value = ISO8601Utils.format(date, true);
+ }
+ out.value(value);
+ }
+ }
+
+ @Override
+ public Date read(JsonReader in) throws IOException {
+ try {
+ switch (in.peek()) {
+ case NULL:
+ in.nextNull();
+ return null;
+ default:
+ String date = in.nextString();
+ try {
+ if (dateFormat != null) {
+ return dateFormat.parse(date);
+ }
+ return ISO8601Utils.parse(date, new ParsePosition(0));
+ } catch (ParseException e) {
+ throw new JsonParseException(e);
+ }
+ }
+ } catch (IllegalArgumentException e) {
+ throw new JsonParseException(e);
+ }
+ }
+ }
+
+ public JSON setDateFormat(DateFormat dateFormat) {
+ dateTypeAdapter.setFormat(dateFormat);
+ return this;
+ }
+
+ public JSON setSqlDateFormat(DateFormat dateFormat) {
+ sqlDateTypeAdapter.setFormat(dateFormat);
+ return this;
+ }
+
+}
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/Pair.java
new file mode 100644
index 000000000000..8352d84046a7
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/Pair.java
@@ -0,0 +1,61 @@
+/*
+ * OpenAPI 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: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class Pair {
+ private String name = "";
+ private String value = "";
+
+ public Pair (String name, String value) {
+ setName(name);
+ setValue(value);
+ }
+
+ private void setName(String name) {
+ if (!isValidString(name)) {
+ return;
+ }
+
+ this.name = name;
+ }
+
+ private void setValue(String value) {
+ if (!isValidString(value)) {
+ return;
+ }
+
+ this.value = value;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public String getValue() {
+ return this.value;
+ }
+
+ private boolean isValidString(String arg) {
+ if (arg == null) {
+ return false;
+ }
+
+ if (arg.trim().isEmpty()) {
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ProgressRequestBody.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ProgressRequestBody.java
new file mode 100644
index 000000000000..924dd8668973
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ProgressRequestBody.java
@@ -0,0 +1,73 @@
+/*
+ * OpenAPI 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: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client;
+
+import okhttp3.MediaType;
+import okhttp3.RequestBody;
+
+import java.io.IOException;
+
+import okio.Buffer;
+import okio.BufferedSink;
+import okio.ForwardingSink;
+import okio.Okio;
+import okio.Sink;
+
+public class ProgressRequestBody extends RequestBody {
+
+ private final RequestBody requestBody;
+
+ private final ApiCallback callback;
+
+ public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) {
+ this.requestBody = requestBody;
+ this.callback = callback;
+ }
+
+ @Override
+ public MediaType contentType() {
+ return requestBody.contentType();
+ }
+
+ @Override
+ public long contentLength() throws IOException {
+ return requestBody.contentLength();
+ }
+
+ @Override
+ public void writeTo(BufferedSink sink) throws IOException {
+ BufferedSink bufferedSink = Okio.buffer(sink(sink));
+ requestBody.writeTo(bufferedSink);
+ bufferedSink.flush();
+ }
+
+ private Sink sink(Sink sink) {
+ return new ForwardingSink(sink) {
+
+ long bytesWritten = 0L;
+ long contentLength = 0L;
+
+ @Override
+ public void write(Buffer source, long byteCount) throws IOException {
+ super.write(source, byteCount);
+ if (contentLength == 0) {
+ contentLength = contentLength();
+ }
+
+ bytesWritten += byteCount;
+ callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength);
+ }
+ };
+ }
+}
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ProgressResponseBody.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ProgressResponseBody.java
new file mode 100644
index 000000000000..1235d56f9fda
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ProgressResponseBody.java
@@ -0,0 +1,72 @@
+/*
+ * OpenAPI 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: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client;
+
+import okhttp3.MediaType;
+import okhttp3.ResponseBody;
+
+import java.io.IOException;
+
+import okio.Buffer;
+import okio.BufferedSource;
+import okio.ForwardingSource;
+import okio.Okio;
+import okio.Source;
+
+public class ProgressResponseBody extends ResponseBody {
+
+ private final ResponseBody responseBody;
+ private final ApiCallback callback;
+ private BufferedSource bufferedSource;
+
+ public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) {
+ this.responseBody = responseBody;
+ this.callback = callback;
+ }
+
+ @Override
+ public MediaType contentType() {
+ return responseBody.contentType();
+ }
+
+ @Override
+ public long contentLength() {
+ return responseBody.contentLength();
+ }
+
+ @Override
+ public BufferedSource source() {
+ if (bufferedSource == null) {
+ bufferedSource = Okio.buffer(source(responseBody.source()));
+ }
+ return bufferedSource;
+ }
+
+ private Source source(Source source) {
+ return new ForwardingSource(source) {
+ long totalBytesRead = 0L;
+
+ @Override
+ public long read(Buffer sink, long byteCount) throws IOException {
+ long bytesRead = super.read(sink, byteCount);
+ // read() returns the number of bytes read, or -1 if this source is exhausted.
+ totalBytesRead += bytesRead != -1 ? bytesRead : 0;
+ callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1);
+ return bytesRead;
+ }
+ };
+ }
+}
+
+
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ServerConfiguration.java
new file mode 100644
index 000000000000..a1107a8690e4
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ServerConfiguration.java
@@ -0,0 +1,58 @@
+package org.openapitools.client;
+
+import java.util.Map;
+
+/**
+ * Representing a Server configuration.
+ */
+public class ServerConfiguration {
+ public String URL;
+ public String description;
+ public Map variables;
+
+ /**
+ * @param URL A URL to the target host.
+ * @param description A describtion of the host designated by the URL.
+ * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
+ */
+ public ServerConfiguration(String URL, String description, Map variables) {
+ this.URL = URL;
+ this.description = description;
+ this.variables = variables;
+ }
+
+ /**
+ * Format URL template using given variables.
+ *
+ * @param variables A map between a variable name and its value.
+ * @return Formatted URL.
+ */
+ public String URL(Map variables) {
+ String url = this.URL;
+
+ // go through variables and replace placeholders
+ for (Map.Entry variable: this.variables.entrySet()) {
+ String name = variable.getKey();
+ ServerVariable serverVariable = variable.getValue();
+ String value = serverVariable.defaultValue;
+
+ if (variables != null && variables.containsKey(name)) {
+ value = variables.get(name);
+ if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
+ throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + ".");
+ }
+ }
+ url = url.replaceAll("\\{" + name + "\\}", value);
+ }
+ return url;
+ }
+
+ /**
+ * Format URL template using default server variables.
+ *
+ * @return Formatted URL.
+ */
+ public String URL() {
+ return URL(null);
+ }
+}
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ServerVariable.java
new file mode 100644
index 000000000000..c2f13e216662
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ServerVariable.java
@@ -0,0 +1,23 @@
+package org.openapitools.client;
+
+import java.util.HashSet;
+
+/**
+ * Representing a Server Variable for server URL template substitution.
+ */
+public class ServerVariable {
+ public String description;
+ public String defaultValue;
+ public HashSet enumValues = null;
+
+ /**
+ * @param description A description for the server variable.
+ * @param defaultValue The default value to use for substitution.
+ * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set.
+ */
+ public ServerVariable(String description, String defaultValue, HashSet enumValues) {
+ this.description = description;
+ this.defaultValue = defaultValue;
+ this.enumValues = enumValues;
+ }
+}
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/StringUtil.java
new file mode 100644
index 000000000000..4dc60597910a
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/StringUtil.java
@@ -0,0 +1,83 @@
+/*
+ * OpenAPI 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: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class StringUtil {
+ /**
+ * Check if the given array contains the given value (with case-insensitive comparison).
+ *
+ * @param array The array
+ * @param value The value to search
+ * @return true if the array contains the value
+ */
+ public static boolean containsIgnoreCase(String[] array, String value) {
+ for (String str : array) {
+ if (value == null && str == null) {
+ return true;
+ }
+ if (value != null && value.equalsIgnoreCase(str)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Join an array of strings with the given separator.
+ *
+ * Note: This might be replaced by utility method from commons-lang or guava someday
+ * if one of those libraries is added as dependency.
+ *
+ *
+ * @param array The array of strings
+ * @param separator The separator
+ * @return the resulting string
+ */
+ public static String join(String[] array, String separator) {
+ int len = array.length;
+ if (len == 0) {
+ return "";
+ }
+
+ StringBuilder out = new StringBuilder();
+ out.append(array[0]);
+ for (int i = 1; i < len; i++) {
+ out.append(separator).append(array[i]);
+ }
+ return out.toString();
+ }
+
+ /**
+ * Join a list of strings with the given separator.
+ *
+ * @param list The list of strings
+ * @param separator The separator
+ * @return the resulting string
+ */
+ public static String join(Collection list, String separator) {
+ Iterator iterator = list.iterator();
+ StringBuilder out = new StringBuilder();
+ if (iterator.hasNext()) {
+ out.append(iterator.next());
+ }
+ while (iterator.hasNext()) {
+ out.append(separator).append(iterator.next());
+ }
+ return out.toString();
+ }
+}
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java
new file mode 100644
index 000000000000..62f86373b3c7
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java
@@ -0,0 +1,179 @@
+/*
+ * OpenAPI 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: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiCallback;
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.ApiOperation;
+import org.openapitools.client.ApiResponse;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.Pair;
+import org.openapitools.client.ProgressRequestBody;
+import org.openapitools.client.ProgressResponseBody;
+
+import com.google.gson.reflect.TypeToken;
+import io.swagger.v3.oas.models.Operation;
+import io.swagger.v3.oas.models.parameters.Parameter;
+
+import java.io.IOException;
+
+
+import org.openapitools.client.model.Client;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class AnotherFakeApi {
+ private ApiClient localVarApiClient;
+
+ public AnotherFakeApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public AnotherFakeApi(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return localVarApiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ /**
+ * Build call for call123testSpecialTags
+ * @param body client model (required)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
successful operation
-
+
+ */
+ public okhttp3.Call call123testSpecialTagsCall(Client body, final ApiCallback _callback) throws ApiException {
+ Object localVarPostBody = body;
+
+ // create path and map variables
+ ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("call123testSpecialTags");
+ if (apiOperation == null) {
+ throw new ApiException("Operation not found in OAS");
+ }
+ Operation operation = apiOperation.getOperation();
+ String localVarPath = apiOperation.getPath();
+ Map paramMap = new HashMap<>();
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams);
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call call123testSpecialTagsValidateBeforeCall(Client body, final ApiCallback _callback) throws ApiException {
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException("Missing the required parameter 'body' when calling call123testSpecialTags(Async)");
+ }
+
+
+ okhttp3.Call localVarCall = call123testSpecialTagsCall(body, _callback);
+ return localVarCall;
+
+ }
+
+ /**
+ * To test special tags
+ * To test special tags and operation ID starting with number
+ * @param body client model (required)
+ * @return Client
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
successful operation
-
+
+ */
+ public Client call123testSpecialTags(Client body) throws ApiException {
+ ApiResponse localVarResp = call123testSpecialTagsWithHttpInfo(body);
+ return localVarResp.getData();
+ }
+
+ /**
+ * To test special tags
+ * To test special tags and operation ID starting with number
+ * @param body client model (required)
+ * @return ApiResponse<Client>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
successful operation
-
+
+ */
+ public ApiResponse call123testSpecialTagsWithHttpInfo(Client body) throws ApiException {
+ okhttp3.Call localVarCall = call123testSpecialTagsValidateBeforeCall(body, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * To test special tags (asynchronously)
+ * To test special tags and operation ID starting with number
+ * @param body client model (required)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
successful operation
-
+
+ */
+ public okhttp3.Call call123testSpecialTagsAsync(Client body, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = call123testSpecialTagsValidateBeforeCall(body, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+}
diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java
new file mode 100644
index 000000000000..f0df2ec4fe2d
--- /dev/null
+++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java
@@ -0,0 +1,1998 @@
+/*
+ * OpenAPI 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: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiCallback;
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.ApiOperation;
+import org.openapitools.client.ApiResponse;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.Pair;
+import org.openapitools.client.ProgressRequestBody;
+import org.openapitools.client.ProgressResponseBody;
+
+import com.google.gson.reflect.TypeToken;
+import io.swagger.v3.oas.models.Operation;
+import io.swagger.v3.oas.models.parameters.Parameter;
+
+import java.io.IOException;
+
+
+import java.math.BigDecimal;
+import org.openapitools.client.model.Client;
+import java.io.File;
+import org.openapitools.client.model.FileSchemaTestClass;
+import org.threeten.bp.LocalDate;
+import org.threeten.bp.OffsetDateTime;
+import org.openapitools.client.model.OuterComposite;
+import org.openapitools.client.model.User;
+import org.openapitools.client.model.XmlItem;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class FakeApi {
+ private ApiClient localVarApiClient;
+
+ public FakeApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public FakeApi(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return localVarApiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ /**
+ * Build call for createXmlItem
+ * @param xmlItem XmlItem Body (required)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
successful operation
-
+
+ */
+ public okhttp3.Call createXmlItemCall(XmlItem xmlItem, final ApiCallback _callback) throws ApiException {
+ Object localVarPostBody = xmlItem;
+
+ // create path and map variables
+ ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("createXmlItem");
+ if (apiOperation == null) {
+ throw new ApiException("Operation not found in OAS");
+ }
+ Operation operation = apiOperation.getOperation();
+ String localVarPath = apiOperation.getPath();
+ Map paramMap = new HashMap<>();
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams);
+
+ final String[] localVarAccepts = {
+
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call createXmlItemValidateBeforeCall(XmlItem xmlItem, final ApiCallback _callback) throws ApiException {
+
+ // verify the required parameter 'xmlItem' is set
+ if (xmlItem == null) {
+ throw new ApiException("Missing the required parameter 'xmlItem' when calling createXmlItem(Async)");
+ }
+
+
+ okhttp3.Call localVarCall = createXmlItemCall(xmlItem, _callback);
+ return localVarCall;
+
+ }
+
+ /**
+ * creates an XmlItem
+ * this route creates an XmlItem
+ * @param xmlItem XmlItem Body (required)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
successful operation
-
+
+ */
+ public void createXmlItem(XmlItem xmlItem) throws ApiException {
+ createXmlItemWithHttpInfo(xmlItem);
+ }
+
+ /**
+ * creates an XmlItem
+ * this route creates an XmlItem
+ * @param xmlItem XmlItem Body (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
successful operation
-
+
+ */
+ public ApiResponse createXmlItemWithHttpInfo(XmlItem xmlItem) throws ApiException {
+ okhttp3.Call localVarCall = createXmlItemValidateBeforeCall(xmlItem, null);
+ return localVarApiClient.execute(localVarCall);
+ }
+
+ /**
+ * creates an XmlItem (asynchronously)
+ * this route creates an XmlItem
+ * @param xmlItem XmlItem Body (required)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
successful operation
-
+
+ */
+ public okhttp3.Call createXmlItemAsync(XmlItem xmlItem, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = createXmlItemValidateBeforeCall(xmlItem, _callback);
+ localVarApiClient.executeAsync(localVarCall, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for fakeOuterBooleanSerialize
+ * @param body Input boolean as post body (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
Output boolean
-
+
+ */
+ public okhttp3.Call fakeOuterBooleanSerializeCall(Boolean body, final ApiCallback _callback) throws ApiException {
+ Object localVarPostBody = body;
+
+ // create path and map variables
+ ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("fakeOuterBooleanSerialize");
+ if (apiOperation == null) {
+ throw new ApiException("Operation not found in OAS");
+ }
+ Operation operation = apiOperation.getOperation();
+ String localVarPath = apiOperation.getPath();
+ Map paramMap = new HashMap<>();
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams);
+
+ final String[] localVarAccepts = {
+ "*/*"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call fakeOuterBooleanSerializeValidateBeforeCall(Boolean body, final ApiCallback _callback) throws ApiException {
+
+
+ okhttp3.Call localVarCall = fakeOuterBooleanSerializeCall(body, _callback);
+ return localVarCall;
+
+ }
+
+ /**
+ *
+ * Test serialization of outer boolean types
+ * @param body Input boolean as post body (optional)
+ * @return Boolean
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
Output boolean
-
+
+ */
+ public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException {
+ ApiResponse localVarResp = fakeOuterBooleanSerializeWithHttpInfo(body);
+ return localVarResp.getData();
+ }
+
+ /**
+ *
+ * Test serialization of outer boolean types
+ * @param body Input boolean as post body (optional)
+ * @return ApiResponse<Boolean>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
Output boolean
-
+
+ */
+ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException {
+ okhttp3.Call localVarCall = fakeOuterBooleanSerializeValidateBeforeCall(body, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * (asynchronously)
+ * Test serialization of outer boolean types
+ * @param body Input boolean as post body (optional)
+ * @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
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
Output boolean
-
+
+ */
+ public okhttp3.Call fakeOuterBooleanSerializeAsync(Boolean body, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = fakeOuterBooleanSerializeValidateBeforeCall(body, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for fakeOuterCompositeSerialize
+ * @param body Input composite as post body (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
Output composite
-
+
+ */
+ public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite body, final ApiCallback _callback) throws ApiException {
+ Object localVarPostBody = body;
+
+ // create path and map variables
+ ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("fakeOuterCompositeSerialize");
+ if (apiOperation == null) {
+ throw new ApiException("Operation not found in OAS");
+ }
+ Operation operation = apiOperation.getOperation();
+ String localVarPath = apiOperation.getPath();
+ Map paramMap = new HashMap<>();
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams);
+
+ final String[] localVarAccepts = {
+ "*/*"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite body, final ApiCallback _callback) throws ApiException {
+
+
+ okhttp3.Call localVarCall = fakeOuterCompositeSerializeCall(body, _callback);
+ return localVarCall;
+
+ }
+
+ /**
+ *
+ * Test serialization of object with outer number type
+ * @param body Input composite as post body (optional)
+ * @return OuterComposite
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
Output composite
-
+
+ */
+ public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException {
+ ApiResponse localVarResp = fakeOuterCompositeSerializeWithHttpInfo(body);
+ return localVarResp.getData();
+ }
+
+ /**
+ *
+ * Test serialization of object with outer number type
+ * @param body Input composite as post body (optional)
+ * @return ApiResponse<OuterComposite>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
Output composite
-
+
+ */
+ public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException {
+ okhttp3.Call localVarCall = fakeOuterCompositeSerializeValidateBeforeCall(body, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * (asynchronously)
+ * Test serialization of object with outer number type
+ * @param body Input composite as post body (optional)
+ * @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
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
Output composite
-
+
+ */
+ public okhttp3.Call fakeOuterCompositeSerializeAsync(OuterComposite body, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = fakeOuterCompositeSerializeValidateBeforeCall(body, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for fakeOuterNumberSerialize
+ * @param body Input number as post body (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
Output number
-
+
+ */
+ public okhttp3.Call fakeOuterNumberSerializeCall(BigDecimal body, final ApiCallback _callback) throws ApiException {
+ Object localVarPostBody = body;
+
+ // create path and map variables
+ ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("fakeOuterNumberSerialize");
+ if (apiOperation == null) {
+ throw new ApiException("Operation not found in OAS");
+ }
+ Operation operation = apiOperation.getOperation();
+ String localVarPath = apiOperation.getPath();
+ Map paramMap = new HashMap<>();
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams);
+
+ final String[] localVarAccepts = {
+ "*/*"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call fakeOuterNumberSerializeValidateBeforeCall(BigDecimal body, final ApiCallback _callback) throws ApiException {
+
+
+ okhttp3.Call localVarCall = fakeOuterNumberSerializeCall(body, _callback);
+ return localVarCall;
+
+ }
+
+ /**
+ *
+ * Test serialization of outer number types
+ * @param body Input number as post body (optional)
+ * @return BigDecimal
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
Output number
-
+
+ */
+ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException {
+ ApiResponse localVarResp = fakeOuterNumberSerializeWithHttpInfo(body);
+ return localVarResp.getData();
+ }
+
+ /**
+ *
+ * Test serialization of outer number types
+ * @param body Input number as post body (optional)
+ * @return ApiResponse<BigDecimal>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
Output number
-
+
+ */
+ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException {
+ okhttp3.Call localVarCall = fakeOuterNumberSerializeValidateBeforeCall(body, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * (asynchronously)
+ * Test serialization of outer number types
+ * @param body Input number as post body (optional)
+ * @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
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
Output number
-
+
+ */
+ public okhttp3.Call fakeOuterNumberSerializeAsync(BigDecimal body, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = fakeOuterNumberSerializeValidateBeforeCall(body, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for fakeOuterStringSerialize
+ * @param body Input string as post body (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+
Status Code
Description
Response Headers
+
200
Output string
-
+
+ */
+ public okhttp3.Call fakeOuterStringSerializeCall(String body, final ApiCallback _callback) throws ApiException {
+ Object localVarPostBody = body;
+
+ // create path and map variables
+ ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("fakeOuterStringSerialize");
+ if (apiOperation == null) {
+ throw new ApiException("Operation not found in OAS");
+ }
+ Operation operation = apiOperation.getOperation();
+ String localVarPath = apiOperation.getPath();
+ Map paramMap = new HashMap<>();
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap