diff --git a/bin/java-petstore-all.sh b/bin/java-petstore-all.sh
index 714faa4dc71e..e12ddf3c51ad 100755
--- a/bin/java-petstore-all.sh
+++ b/bin/java-petstore-all.sh
@@ -6,8 +6,8 @@
./bin/java-petstore-google-api-client.sh
./bin/java-petstore-jersey1.sh
./bin/java-petstore-jersey2-java6.sh
+./bin/java-petstore-jersey2-java7.sh
./bin/java-petstore-jersey2-java8.sh
-./bin/java-petstore-jersey2.sh
./bin/java-petstore-microprofile.sh
./bin/java-petstore-native.sh
./bin/java-petstore-okhttp-gson-parcelable.sh
diff --git a/bin/java-petstore-jersey2-java6.sh b/bin/java-petstore-jersey2-java6.sh
index 4a5b032d0db7..bd673d765171 100755
--- a/bin/java-petstore-jersey2-java6.sh
+++ b/bin/java-petstore-jersey2-java6.sh
@@ -27,7 +27,7 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
-ags="generate --artifact-id petstore-jersey2-java6 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-jersey2.json -o samples/client/petstore/java/jersey2-java6 --additional-properties hideGenerationTimestamp=true,supportJava6=true,booleanGetterPrefix=is $@"
+ags="generate --artifact-id petstore-jersey2-java6 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -o samples/client/petstore/java/jersey2-java6 --additional-properties hideGenerationTimestamp=true,supportJava6=true,booleanGetterPrefix=is $@"
echo "Removing files and folders under samples/client/petstore/java/jersey2-java6/src/main"
rm -rf samples/client/petstore/java/jersey2-java6/src/main
diff --git a/bin/java-petstore-jersey2-java7.json b/bin/java-petstore-jersey2-java7.json
new file mode 100644
index 000000000000..a5e2254fdb3a
--- /dev/null
+++ b/bin/java-petstore-jersey2-java7.json
@@ -0,0 +1,5 @@
+{
+ "library": "jersey2",
+ "java8": false,
+ "artifactId": "petstore-jersey2-java7"
+}
diff --git a/bin/java-petstore-jersey2.sh b/bin/java-petstore-jersey2-java7.sh
similarity index 94%
rename from bin/java-petstore-jersey2.sh
rename to bin/java-petstore-jersey2-java7.sh
index b6cd91ea9aec..a72b3365d4b4 100755
--- a/bin/java-petstore-jersey2.sh
+++ b/bin/java-petstore-jersey2-java7.sh
@@ -27,7 +27,7 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
-ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-jersey2.json -o samples/client/petstore/java/jersey2 --additional-properties hideGenerationTimestamp=true $@"
+ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-jersey2-java7.json -o samples/client/petstore/java/jersey2-java7 --additional-properties java8=false,hideGenerationTimestamp=true $@"
echo "Removing files and folders under samples/client/petstore/java/jersey2/src/main"
rm -rf samples/client/petstore/java/jersey2/src/main
diff --git a/bin/java-petstore-jersey2.json b/bin/java-petstore-jersey2.json
deleted file mode 100644
index 79ed4cbc2e12..000000000000
--- a/bin/java-petstore-jersey2.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "library": "jersey2",
- "artifactId": "petstore-jersey2"
-}
diff --git a/bin/windows/java-petstore-all.bat b/bin/windows/java-petstore-all.bat
index 816919bb8fd1..e141ec8ef9f1 100644
--- a/bin/windows/java-petstore-all.bat
+++ b/bin/windows/java-petstore-all.bat
@@ -1,5 +1,5 @@
call .\bin\windows\java-petstore-jersey1.bat
-call .\bin\windows\java-petstore-jersey2.bat
+call .\bin\windows\java-petstore-jersey2-java8.bat
call .\bin\windows\java-petstore-feign.bat
call .\bin\windows\java-petstore-feign-10x.bat
call .\bin\windows\java-petstore-native.bat
diff --git a/bin/windows/java-petstore-jersey2-java6.bat b/bin/windows/java-petstore-jersey2-java6.bat
index e41cf3964691..4efac3d2d7ce 100644
--- a/bin/windows/java-petstore-jersey2-java6.bat
+++ b/bin/windows/java-petstore-jersey2-java6.bat
@@ -5,6 +5,6 @@ If Not Exist %executable% (
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
-set ags=generate --artifact-id petstore-jersey2-java6 -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-jersey2.json -o samples\client\petstore\java\jersey2-java6 --additional-properties hideGenerationTimestamp=true,supportJava6=true,booleanGetterPrefix=is
+set ags=generate --artifact-id petstore-jersey2-java6 -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -o samples\client\petstore\java\jersey2-java6 --additional-properties hideGenerationTimestamp=true,supportJava6=true,booleanGetterPrefix=is
java %JAVA_OPTS% -jar %executable% %ags%
diff --git a/bin/windows/java-petstore-jersey2.bat b/bin/windows/java-petstore-jersey2-java8.bat
similarity index 71%
rename from bin/windows/java-petstore-jersey2.bat
rename to bin/windows/java-petstore-jersey2-java8.bat
index f0f5ea9e2d5b..7ea0c334e78a 100644
--- a/bin/windows/java-petstore-jersey2.bat
+++ b/bin/windows/java-petstore-jersey2-java8.bat
@@ -5,6 +5,6 @@ If Not Exist %executable% (
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
-set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-jersey2.json -o samples\client\petstore\java\jersey2 --additional-properties hideGenerationTimestamp=true
+set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-jersey2-java7.json -o samples\client\petstore\java\jersey2 --additional-properties hideGenerationTimestamp=true
java %JAVA_OPTS% -jar %executable% %ags%
diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md
index 399aa7f5fcbb..d5efbbd4ba4b 100644
--- a/docs/generators/groovy.md
+++ b/docs/generators/groovy.md
@@ -24,7 +24,7 @@ sidebar_label: groovy
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|invokerPackage|root package for generated code| |org.openapitools.api|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md
index 47c60b6f501a..240a6bb85e25 100644
--- a/docs/generators/java-inflector.md
+++ b/docs/generators/java-inflector.md
@@ -26,7 +26,7 @@ sidebar_label: java-inflector
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|invokerPackage|root package for generated code| |org.openapitools.controllers|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md
index 7b37f5dd9a6e..2a7c74842272 100644
--- a/docs/generators/java-msf4j.md
+++ b/docs/generators/java-msf4j.md
@@ -27,7 +27,7 @@ sidebar_label: java-msf4j
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|implFolder|folder for generated implementation code| |src/main/java|
|invokerPackage|root package for generated code| |org.openapitools.api|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|library|library template (sub-template)|
**jersey1**
Jersey core 1.x
**jersey2**
Jersey core 2.x
|jersey2|
|licenseName|The name of the license| |Unlicense|
diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md
index a78d000aa76d..360cecdad37b 100644
--- a/docs/generators/java-pkmst.md
+++ b/docs/generators/java-pkmst.md
@@ -28,7 +28,7 @@ sidebar_label: java-pkmst
|groupId|groupId in generated pom.xml| |com.prokarma|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|invokerPackage|root package for generated code| |com.prokarma.pkmst.controller|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md
index 47dc598c83c2..db5a6cce52d7 100644
--- a/docs/generators/java-play-framework.md
+++ b/docs/generators/java-play-framework.md
@@ -30,7 +30,7 @@ sidebar_label: java-play-framework
|handleExceptions|Add a 'throw exception' to each controller function. Add also a custom error handler where you can put your custom logic| |true|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|invokerPackage|root package for generated code| |org.openapitools.api|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md
index 641ed21d2c5e..2975825ef19c 100644
--- a/docs/generators/java-undertow-server.md
+++ b/docs/generators/java-undertow-server.md
@@ -26,7 +26,7 @@ sidebar_label: java-undertow-server
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|invokerPackage|root package for generated code| |org.openapitools.handler|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md
index 1fe08d3b107c..96c7193b2881 100644
--- a/docs/generators/java-vertx-web.md
+++ b/docs/generators/java-vertx-web.md
@@ -26,7 +26,7 @@ sidebar_label: java-vertx-web
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|invokerPackage|root package for generated code| |org.openapitools.vertxweb.server|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md
index e2d68f9c5e31..626eca2911f9 100644
--- a/docs/generators/java-vertx.md
+++ b/docs/generators/java-vertx.md
@@ -26,7 +26,7 @@ sidebar_label: java-vertx
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|invokerPackage|root package for generated code| |org.openapitools|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
diff --git a/docs/generators/java.md b/docs/generators/java.md
index 3ca1326e164b..716c1beb9b57 100644
--- a/docs/generators/java.md
+++ b/docs/generators/java.md
@@ -29,7 +29,7 @@ sidebar_label: java
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|invokerPackage|root package for generated code| |org.openapitools.client|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|library|library template (sub-template) to use|
**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.
**jersey2**
HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
**feign**
HTTP client: OpenFeign 9.x (deprecated) or 10.x (default). JSON processing: Jackson 2.9.x.
**okhttp-gson**
[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
**retrofit**
HTTP client: OkHttp 2.x. JSON processing: Gson 2.x (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.
**retrofit2**
HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)
**resttemplate**
HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
**webclient**
HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
**resteasy**
HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
**vertx**
HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
**google-api-client**
HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
**rest-assured**
HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
**native**
HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
**microprofile**
HTTP client: Microprofile client X.x. JSON processing: Jackson 2.9.x
|okhttp-gson|
|licenseName|The name of the license| |Unlicense|
@@ -51,7 +51,7 @@ sidebar_label: java
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src/main/java|
-|supportJava6|Whether to support Java6 with the Jersey1 library.| |false|
+|supportJava6|Whether to support Java6 with the Jersey1 library. This option has been deprecated and will be removed in the 5.x release| |false|
|useBeanValidation|Use BeanValidation API annotations| |false|
|useGzipFeature|Send gzip-encoded requests| |false|
|usePlayWS|Use Play! Async HTTP client (Play WS API)| |false|
diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md
index dbb740fd3741..d42714ad38ed 100644
--- a/docs/generators/jaxrs-cxf-cdi.md
+++ b/docs/generators/jaxrs-cxf-cdi.md
@@ -30,7 +30,7 @@ sidebar_label: jaxrs-cxf-cdi
|implFolder|folder for generated implementation code| |src/main/java|
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
|invokerPackage|root package for generated code| |org.openapitools.api|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|library|library template (sub-template)|
**<default>**
JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
**quarkus**
Server using Quarkus
**thorntail**
Server using Thorntail
**openliberty**
Server using Open Liberty
**helidon**
Server using Helidon
|<default>|
|licenseName|The name of the license| |Unlicense|
diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md
index 41b28b8bc0b8..cea106975e6e 100644
--- a/docs/generators/jaxrs-cxf-client.md
+++ b/docs/generators/jaxrs-cxf-client.md
@@ -26,7 +26,7 @@ sidebar_label: jaxrs-cxf-client
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|invokerPackage|root package for generated code| |org.openapitools.api|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md
index 68373c8e73bc..b514e1d4b0f6 100644
--- a/docs/generators/jaxrs-cxf-extended.md
+++ b/docs/generators/jaxrs-cxf-extended.md
@@ -33,7 +33,7 @@ sidebar_label: jaxrs-cxf-extended
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|implFolder|folder for generated implementation code| |src/main/java|
|invokerPackage|root package for generated code| |org.openapitools.api|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md
index 4e524009c7c1..b65f8d844bc9 100644
--- a/docs/generators/jaxrs-cxf.md
+++ b/docs/generators/jaxrs-cxf.md
@@ -32,7 +32,7 @@ sidebar_label: jaxrs-cxf
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|implFolder|folder for generated implementation code| |src/main/java|
|invokerPackage|root package for generated code| |org.openapitools.api|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md
index 80948607ec94..9618f052ab6b 100644
--- a/docs/generators/jaxrs-jersey.md
+++ b/docs/generators/jaxrs-jersey.md
@@ -27,7 +27,7 @@ sidebar_label: jaxrs-jersey
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|implFolder|folder for generated implementation code| |src/main/java|
|invokerPackage|root package for generated code| |org.openapitools.api|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|library|library template (sub-template)|
**jersey1**
Jersey core 1.x
**jersey2**
Jersey core 2.x
|jersey2|
|licenseName|The name of the license| |Unlicense|
diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md
index 50c05785dc61..8961c6da03dd 100644
--- a/docs/generators/jaxrs-resteasy-eap.md
+++ b/docs/generators/jaxrs-resteasy-eap.md
@@ -28,7 +28,7 @@ sidebar_label: jaxrs-resteasy-eap
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|implFolder|folder for generated implementation code| |src/main/java|
|invokerPackage|root package for generated code| |org.openapitools.api|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md
index 66e7882c4409..bcff6b2d13a0 100644
--- a/docs/generators/jaxrs-resteasy.md
+++ b/docs/generators/jaxrs-resteasy.md
@@ -28,7 +28,7 @@ sidebar_label: jaxrs-resteasy
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|implFolder|folder for generated implementation code| |src/main/java|
|invokerPackage|root package for generated code| |org.openapitools.api|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md
index 1d4e97cbf8b6..3deb5c4260a2 100644
--- a/docs/generators/jaxrs-spec.md
+++ b/docs/generators/jaxrs-spec.md
@@ -30,7 +30,7 @@ sidebar_label: jaxrs-spec
|implFolder|folder for generated implementation code| |src/main/java|
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
|invokerPackage|root package for generated code| |org.openapitools.api|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|library|library template (sub-template)|
**<default>**
JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
**quarkus**
Server using Quarkus
**thorntail**
Server using Thorntail
**openliberty**
Server using Open Liberty
**helidon**
Server using Helidon
|<default>|
|licenseName|The name of the license| |Unlicense|
diff --git a/docs/generators/spring.md b/docs/generators/spring.md
index 93159837dd49..6116bd3f430f 100644
--- a/docs/generators/spring.md
+++ b/docs/generators/spring.md
@@ -34,7 +34,7 @@ sidebar_label: spring
|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false|
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
|invokerPackage|root package for generated code| |org.openapitools.api|
-|java8|Option. Use Java8 classes instead of third party equivalents|
**true**
Use Java 8 classes such as Base64. Use java8 default interface when a responseWrapper is used
**false**
Various third party libraries as needed
|false|
+|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64. Use java8 default interface when a responseWrapper is used
**false**
Various third party libraries as needed
|true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|library|library template (sub-template)|
**spring-boot**
Spring-boot Server application using the SpringFox integration.
**spring-mvc**
Spring-MVC Server application using the SpringFox integration.
**spring-cloud**
Spring-Cloud-Feign client with Spring-Boot auto-configured settings.
|spring-boot|
|licenseName|The name of the license| |Unlicense|
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java
index b1c48917d726..b0778f11f038 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java
@@ -62,7 +62,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
protected String dateLibrary = "threetenbp";
protected boolean supportAsync = false;
- protected boolean java8Mode = false;
+ protected boolean java8Mode = true;
protected boolean withXml = false;
protected String invokerPackage = "org.openapitools";
protected String groupId = "org.openapitools";
@@ -205,7 +205,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
dateLibrary.setEnum(dateOptions);
cliOptions.add(dateLibrary);
- CliOption java8Mode = CliOption.newBoolean(JAVA8_MODE, "Option. Use Java8 classes instead of third party equivalents", this.java8Mode);
+ CliOption java8Mode = CliOption.newBoolean(JAVA8_MODE, "Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped", this.java8Mode);
Map java8ModeOptions = new HashMap<>();
java8ModeOptions.put("true", "Use Java 8 classes such as Base64");
java8ModeOptions.put("false", "Various third party libraries as needed");
@@ -480,10 +480,15 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
importMapping.put("com.fasterxml.jackson.annotation.JsonProperty", "com.fasterxml.jackson.annotation.JsonCreator");
if (additionalProperties.containsKey(JAVA8_MODE)) {
+ LOGGER.info("containing java 8 mode ...");
setJava8Mode(Boolean.parseBoolean(additionalProperties.get(JAVA8_MODE).toString()));
if (java8Mode) {
- additionalProperties.put("java8", "true");
+ LOGGER.info("containing java 8 mode to true...");
+ additionalProperties.put("java8", true);
+ } else {
+ additionalProperties.put("java8", false);
}
+ LOGGER.info("containing java 8 mode to something {}...", java8Mode);
}
if (additionalProperties.containsKey(SUPPORT_ASYNC)) {
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 ff4168bfa4c2..d524849dd9ab 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
@@ -135,7 +135,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
cliOptions.add(CliOption.newBoolean(PARCELABLE_MODEL, "Whether to generate models for Android that implement Parcelable with the okhttp-gson library."));
cliOptions.add(CliOption.newBoolean(USE_PLAY_WS, "Use Play! Async HTTP client (Play WS API)"));
cliOptions.add(CliOption.newString(PLAY_VERSION, "Version of Play! Framework (possible values \"play24\", \"play25\" (default), \"play26\")"));
- cliOptions.add(CliOption.newBoolean(SUPPORT_JAVA6, "Whether to support Java6 with the Jersey1 library."));
+ cliOptions.add(CliOption.newBoolean(SUPPORT_JAVA6, "Whether to support Java6 with the Jersey1 library. This option has been deprecated and will be removed in the 5.x release"));
cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations"));
cliOptions.add(CliOption.newBoolean(PERFORM_BEANVALIDATION, "Perform BeanValidation"));
cliOptions.add(CliOption.newBoolean(USE_GZIP_FEATURE, "Send gzip-encoded requests"));
diff --git a/pom.xml b/pom.xml
index 05c553e33b89..426790d06a4b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -691,7 +691,7 @@
- java-client-jersey2
+ java-client-jersey2-java7env
@@ -699,7 +699,7 @@
- samples/client/petstore/java/jersey2
+ samples/client/petstore/java/jersey2-java7
@@ -1303,7 +1303,6 @@
samples/client/petstore/java/feignsamples/client/petstore/java/feign10xsamples/client/petstore/java/jersey1
- samples/client/petstore/java/jersey2samples/client/petstore/java/jersey2-java8samples/client/petstore/java/okhttp-gsonsamples/client/petstore/java/retrofit
@@ -1397,7 +1396,7 @@
samples/client/petstore/scala-httpclientsamples/client/petstore/java/feignsamples/client/petstore/java/jersey1
- samples/client/petstore/java/jersey2
+ samples/client/petstore/java/jersey2-java7samples/client/petstore/java/okhttp-gsonsamples/client/petstore/java/retrofitsamples/client/petstore/java/retrofit2
diff --git a/samples/client/petstore/java/jersey2-java6/README.md b/samples/client/petstore/java/jersey2-java6/README.md
index 6b7be6d30a2b..5d0d673579b1 100644
--- a/samples/client/petstore/java/jersey2-java6/README.md
+++ b/samples/client/petstore/java/jersey2-java6/README.md
@@ -1,7 +1,6 @@
# petstore-jersey2-java6
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: \" \\
@@ -9,10 +8,10 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
+
## Requirements
Building the API client library requires:
-
1. Java 1.6+
2. Maven/Gradle
@@ -63,8 +62,8 @@ mvn clean package
Then manually install the following JARs:
-- `target/petstore-jersey2-java6-1.0.0.jar`
-- `target/lib/*.jar`
+* `target/petstore-jersey2-java6-1.0.0.jar`
+* `target/lib/*.jar`
## Getting Started
@@ -72,30 +71,31 @@ Please follow the [installation](#installation) instruction and execute the foll
```java
-import org.openapitools.client.*;
-import org.openapitools.client.auth.*;
-import org.openapitools.client.model.*;
+// 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 AnotherFakeApiExample {
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
- 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();
- }
+ 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();
}
+ }
}
```
@@ -200,26 +200,22 @@ Class | Method | HTTP request | Description
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
diff --git a/samples/client/petstore/java/jersey2-java6/build.gradle b/samples/client/petstore/java/jersey2-java6/build.gradle
index 3c60f38a12b6..eb7e3e4b54c3 100644
--- a/samples/client/petstore/java/jersey2-java6/build.gradle
+++ b/samples/client/petstore/java/jersey2-java6/build.gradle
@@ -1,5 +1,6 @@
apply plugin: 'idea'
apply plugin: 'eclipse'
+apply plugin: 'java'
group = 'org.openapitools'
version = '1.0.0'
@@ -18,7 +19,9 @@ buildscript {
repositories {
jcenter()
}
-
+sourceSets {
+ main.java.srcDirs = ['src/main/java']
+}
if(hasProperty('target') && target == 'android') {
@@ -49,7 +52,7 @@ if(hasProperty('target') && target == 'android') {
}
dependencies {
- provided 'javax.annotation:jsr250-api:1.0'
+ provided 'javax.annotation:javax.annotation-api:1.3.2'
}
}
@@ -78,6 +81,7 @@ if(hasProperty('target') && target == 'android') {
apply plugin: 'java'
apply plugin: 'maven'
+
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
@@ -93,33 +97,17 @@ if(hasProperty('target') && target == 'android') {
}
}
-ext {
- swagger_annotations_version = "1.5.22"
- jackson_version = "2.10.3"
- jackson_databind_version = "2.10.3"
- jackson_databind_nullable_version = "0.2.1"
- jersey_version = "2.6"
- commons_io_version=2.5
- commons_lang3_version=3.6
- junit_version = "4.13"
- threetenbp_version = "2.9.10"
-}
-
dependencies {
- compile "io.swagger:swagger-annotations:$swagger_annotations_version"
+ compile 'io.swagger:swagger-annotations:1.5.24'
compile "com.google.code.findbugs:jsr305:3.0.2"
- compile "org.glassfish.jersey.core:jersey-client:$jersey_version"
- compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version"
- compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version"
- compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
- compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
- compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
- compile "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
- compile "commons-io:commons-io:$commons_io_version"
- compile "org.apache.commons:commons-lang3:$commons_lang3_version"
- compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version"
- compile "com.brsanthu:migbase64:2.2"
- testCompile "junit:junit:$junit_version"
+ 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'
+ testCompile 'junit:junit:4.13'
}
javadoc {
diff --git a/samples/client/petstore/java/jersey2-java6/build.sbt b/samples/client/petstore/java/jersey2-java6/build.sbt
index e002c64a04bc..3599c49b7386 100644
--- a/samples/client/petstore/java/jersey2-java6/build.sbt
+++ b/samples/client/petstore/java/jersey2-java6/build.sbt
@@ -9,17 +9,16 @@ lazy val root = (project in file(".")).
publishArtifact in (Compile, packageDoc) := false,
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(
- "io.swagger" % "swagger-annotations" % "1.5.22",
- "org.glassfish.jersey.core" % "jersey-client" % "2.6",
- "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.6",
- "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.6",
- "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile",
- "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile",
- "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile",
- "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile",
- "com.brsanthu" % "migbase64" % "2.2",
- "org.apache.commons" % "commons-lang3" % "3.6",
- "commons-io" % "commons-io" % "2.5",
+ "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.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",
"junit" % "junit" % "4.13" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
)
diff --git a/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md
index 059616ec6baa..0565c2589b3c 100644
--- a/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md
+++ b/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md
@@ -7,9 +7,8 @@ Method | HTTP request | Description
[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
-
-## call123testSpecialTags
-
+
+# **call123testSpecialTags**
> Client call123testSpecialTags(body)
To test special tags
@@ -17,7 +16,6 @@ To test special tags
To test special tags and operation ID starting with number
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -27,29 +25,28 @@ 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");
+ 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();
- }
+ 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 |
@@ -64,11 +61,11 @@ No authorization required
### HTTP request headers
-- **Content-Type**: application/json
-- **Accept**: application/json
+ - **Content-Type**: application/json
+ - **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | successful operation | - |
+**200** | successful operation | - |
diff --git a/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md
index 543c51f066c5..b8c2112acb88 100644
--- a/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md
+++ b/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md
@@ -20,9 +20,8 @@ Method | HTTP request | Description
[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters |
-
-## createXmlItem
-
+
+# **createXmlItem**
> createXmlItem(xmlItem)
creates an XmlItem
@@ -30,7 +29,6 @@ creates an XmlItem
this route creates an XmlItem
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -40,28 +38,27 @@ 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");
+ 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();
- }
+ 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 |
@@ -76,17 +73,16 @@ 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
+ - **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
+**200** | successful operation | - |
+
+# **fakeOuterBooleanSerialize**
> Boolean fakeOuterBooleanSerialize(body)
@@ -94,7 +90,6 @@ No authorization required
Test serialization of outer boolean types
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -104,29 +99,28 @@ 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");
+ 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();
- }
+ 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]
@@ -141,17 +135,16 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: */*
+ - **Content-Type**: Not defined
+ - **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | Output boolean | - |
-
-
-## fakeOuterCompositeSerialize
+**200** | Output boolean | - |
+
+# **fakeOuterCompositeSerialize**
> OuterComposite fakeOuterCompositeSerialize(body)
@@ -159,7 +152,6 @@ No authorization required
Test serialization of object with outer number type
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -169,29 +161,28 @@ 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");
+ 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();
- }
+ 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]
@@ -206,17 +197,16 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: */*
+ - **Content-Type**: Not defined
+ - **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | Output composite | - |
-
-
-## fakeOuterNumberSerialize
+**200** | Output composite | - |
+
+# **fakeOuterNumberSerialize**
> BigDecimal fakeOuterNumberSerialize(body)
@@ -224,7 +214,6 @@ No authorization required
Test serialization of outer number types
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -234,29 +223,28 @@ 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");
+ 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();
- }
+ 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]
@@ -271,17 +259,16 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: */*
+ - **Content-Type**: Not defined
+ - **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | Output number | - |
-
-
-## fakeOuterStringSerialize
+**200** | Output number | - |
+
+# **fakeOuterStringSerialize**
> String fakeOuterStringSerialize(body)
@@ -289,7 +276,6 @@ No authorization required
Test serialization of outer string types
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -299,29 +285,28 @@ 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");
+ 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();
- }
+ 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]
@@ -336,25 +321,23 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: */*
+ - **Content-Type**: Not defined
+ - **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | Output string | - |
-
-
-## testBodyWithFileSchema
+**200** | Output string | - |
+
+# **testBodyWithFileSchema**
> testBodyWithFileSchema(body)
-For this test, the body for this request much reference a schema named `File`.
+For this test, the body for this request much reference a schema named `File`.
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -364,28 +347,27 @@ 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");
+ 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();
- }
+ 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)| |
@@ -400,23 +382,21 @@ No authorization required
### HTTP request headers
-- **Content-Type**: application/json
-- **Accept**: Not defined
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | Success | - |
-
-
-## testBodyWithQueryParams
+**200** | Success | - |
+
+# **testBodyWithQueryParams**
> testBodyWithQueryParams(query, body)
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -426,29 +406,28 @@ 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");
+ 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();
- }
+ 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**| |
@@ -464,25 +443,23 @@ No authorization required
### HTTP request headers
-- **Content-Type**: application/json
-- **Accept**: Not defined
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | Success | - |
-
-
-## testClientModel
+**200** | Success | - |
+
+# **testClientModel**
> Client testClientModel(body)
To test \"client\" model
-To test "client" model
+To test \"client\" model
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -492,29 +469,28 @@ 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");
+ 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();
- }
+ 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 |
@@ -529,28 +505,23 @@ No authorization required
### HTTP request headers
-- **Content-Type**: application/json
-- **Accept**: application/json
+ - **Content-Type**: application/json
+ - **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | successful operation | - |
-
-
-## testEndpointParameters
+**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
- 假端點
- 偽のエンドポイント
- 가짜 엔드 포인트
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -561,46 +532,45 @@ 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");
+ 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();
- }
+ 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 |
@@ -628,18 +598,17 @@ null (empty response body)
### HTTP request headers
-- **Content-Type**: application/x-www-form-urlencoded
-- **Accept**: Not defined
+ - **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
+**400** | Invalid username supplied | - |
+**404** | User not found | - |
+
+# **testEnumParameters**
> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString)
To test enum parameters
@@ -647,7 +616,6 @@ To test enum parameters
To test enum parameters
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -657,35 +625,34 @@ 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");
+ 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();
- }
+ 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: >, $]
@@ -707,26 +674,24 @@ No authorization required
### HTTP request headers
-- **Content-Type**: application/x-www-form-urlencoded
-- **Accept**: Not defined
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **400** | Invalid request | - |
-| **404** | Not found | - |
+**400** | Invalid request | - |
+**404** | Not found | - |
-
-## testGroupParameters
-
-> testGroupParameters().requiredStringGroup(requiredStringGroup).requiredBooleanGroup(requiredBooleanGroup).requiredInt64Group(requiredInt64Group).stringGroup(stringGroup).booleanGroup(booleanGroup).int64Group(int64Group).execute();
+
+# **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;
@@ -736,40 +701,36 @@ 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");
+ 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 {
- api.testGroupParameters()
- .requiredStringGroup(requiredStringGroup)
- .requiredBooleanGroup(requiredBooleanGroup)
- .requiredInt64Group(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();
- }
+ 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 |
@@ -789,23 +750,21 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: Not defined
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **400** | Someting wrong | - |
-
-
-## testInlineAdditionalProperties
+**400** | Someting wrong | - |
+
+# **testInlineAdditionalProperties**
> testInlineAdditionalProperties(param)
test inline additionalProperties
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -815,28 +774,27 @@ 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");
+ 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();
- }
+ 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 |
@@ -851,23 +809,21 @@ No authorization required
### HTTP request headers
-- **Content-Type**: application/json
-- **Accept**: Not defined
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | successful operation | - |
-
-
-## testJsonFormData
+**200** | successful operation | - |
+
+# **testJsonFormData**
> testJsonFormData(param, param2)
test json serialization of form data
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -877,29 +833,28 @@ 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");
+ 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();
- }
+ 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 |
@@ -915,17 +870,16 @@ No authorization required
### HTTP request headers
-- **Content-Type**: application/x-www-form-urlencoded
-- **Accept**: Not defined
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | successful operation | - |
-
-
-## testQueryParameterCollectionFormat
+**200** | successful operation | - |
+
+# **testQueryParameterCollectionFormat**
> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context)
@@ -933,7 +887,6 @@ No authorization required
To test the collection format in query parameters
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -943,32 +896,31 @@ 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");
+ 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();
- }
+ 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)| |
@@ -987,11 +939,11 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: Not defined
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | Success | - |
+**200** | Success | - |
diff --git a/samples/client/petstore/java/jersey2-java6/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/jersey2-java6/docs/FakeClassnameTags123Api.md
index 14a74a37a4e2..bd934e360718 100644
--- a/samples/client/petstore/java/jersey2-java6/docs/FakeClassnameTags123Api.md
+++ b/samples/client/petstore/java/jersey2-java6/docs/FakeClassnameTags123Api.md
@@ -7,9 +7,8 @@ Method | HTTP request | Description
[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
-
-## testClassname
-
+
+# **testClassname**
> Client testClassname(body)
To test class name in snake case
@@ -17,7 +16,6 @@ To test class name in snake case
To test class name in snake case
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -28,35 +26,34 @@ 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");
+ 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();
- }
+ 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 |
@@ -71,11 +68,11 @@ Name | Type | Description | Notes
### HTTP request headers
-- **Content-Type**: application/json
-- **Accept**: application/json
+ - **Content-Type**: application/json
+ - **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | successful operation | - |
+**200** | successful operation | - |
diff --git a/samples/client/petstore/java/jersey2-java6/docs/PetApi.md b/samples/client/petstore/java/jersey2-java6/docs/PetApi.md
index 875a8e6783e9..ca6658ce094a 100644
--- a/samples/client/petstore/java/jersey2-java6/docs/PetApi.md
+++ b/samples/client/petstore/java/jersey2-java6/docs/PetApi.md
@@ -15,15 +15,13 @@ Method | HTTP request | Description
[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
-
-## addPet
-
+
+# **addPet**
> addPet(body)
Add a new pet to the store
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -34,32 +32,31 @@ 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");
+ 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();
- }
+ 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 |
@@ -74,24 +71,22 @@ null (empty response body)
### HTTP request headers
-- **Content-Type**: application/json, application/xml
-- **Accept**: Not defined
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | successful operation | - |
-| **405** | Invalid input | - |
-
-
-## deletePet
+**200** | successful operation | - |
+**405** | Invalid input | - |
+
+# **deletePet**
> deletePet(petId, apiKey)
Deletes a pet
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -102,33 +97,32 @@ 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");
+ 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();
- }
+ 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 |
@@ -144,18 +138,17 @@ null (empty response body)
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: Not defined
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | successful operation | - |
-| **400** | Invalid pet value | - |
-
-
-## findPetsByStatus
+**200** | successful operation | - |
+**400** | Invalid pet value | - |
+
+# **findPetsByStatus**
> List<Pet> findPetsByStatus(status)
Finds Pets by status
@@ -163,7 +156,6 @@ Finds Pets by status
Multiple status values can be provided with comma separated strings
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -174,33 +166,32 @@ 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");
+ 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();
- }
+ 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]
@@ -215,18 +206,17 @@ Name | Type | Description | Notes
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: application/xml, application/json
+ - **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
+**200** | successful operation | - |
+**400** | Invalid status value | - |
+
+# **findPetsByTags**
> List<Pet> findPetsByTags(tags)
Finds Pets by tags
@@ -234,7 +224,6 @@ 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;
@@ -245,33 +234,32 @@ 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");
+ 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 tags = Arrays.asList(); // List | Tags to filter by
- try {
- List 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();
- }
+ PetApi apiInstance = new PetApi(defaultClient);
+ List tags = Arrays.asList(); // List | Tags to filter by
+ try {
+ List 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** | [**List<String>**](String.md)| Tags to filter by |
@@ -286,18 +274,17 @@ Name | Type | Description | Notes
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: application/xml, application/json
+ - **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
+**200** | successful operation | - |
+**400** | Invalid tag value | - |
+
+# **getPetById**
> Pet getPetById(petId)
Find pet by ID
@@ -305,7 +292,6 @@ Find pet by ID
Returns a single pet
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -316,35 +302,34 @@ 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");
+ 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();
- }
+ 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 |
@@ -359,25 +344,23 @@ Name | Type | Description | Notes
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: application/xml, application/json
+ - **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
+**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;
@@ -388,32 +371,31 @@ 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");
+ 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();
- }
+ 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 |
@@ -428,26 +410,24 @@ null (empty response body)
### HTTP request headers
-- **Content-Type**: application/json, application/xml
-- **Accept**: Not defined
+ - **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
+**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;
@@ -458,34 +438,33 @@ 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");
+ 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();
- }
+ 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 |
@@ -502,23 +481,21 @@ null (empty response body)
### HTTP request headers
-- **Content-Type**: application/x-www-form-urlencoded
-- **Accept**: Not defined
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **405** | Invalid input | - |
-
-
-## uploadFile
+**405** | Invalid input | - |
+
+# **uploadFile**
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
uploads an image
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -529,35 +506,34 @@ 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");
+ 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();
- }
+ 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 |
@@ -574,23 +550,21 @@ Name | Type | Description | Notes
### HTTP request headers
-- **Content-Type**: multipart/form-data
-- **Accept**: application/json
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | successful operation | - |
-
-
-## uploadFileWithRequiredFile
+**200** | successful operation | - |
+
+# **uploadFileWithRequiredFile**
> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata)
uploads an image (required)
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -601,35 +575,34 @@ 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");
+ 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();
- }
+ 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 |
@@ -646,11 +619,11 @@ Name | Type | Description | Notes
### HTTP request headers
-- **Content-Type**: multipart/form-data
-- **Accept**: application/json
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | successful operation | - |
+**200** | successful operation | - |
diff --git a/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md b/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md
index 6625d5969ee4..a86b478e55ab 100644
--- a/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md
+++ b/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md
@@ -10,17 +10,15 @@ Method | HTTP request | Description
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
-
-## deleteOrder
-
+
+# **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
+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;
@@ -30,28 +28,27 @@ 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");
+ 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();
- }
+ 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 |
@@ -66,18 +63,17 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: Not defined
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **400** | Invalid ID supplied | - |
-| **404** | Order not found | - |
-
-
-## getInventory
+**400** | Invalid ID supplied | - |
+**404** | Order not found | - |
+
+# **getInventory**
> Map<String, Integer> getInventory()
Returns pet inventories by status
@@ -85,7 +81,6 @@ Returns pet inventories by status
Returns a map of status codes to quantities
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -96,33 +91,32 @@ 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");
+ 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();
- }
+ 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
@@ -135,25 +129,23 @@ This endpoint does not need any parameter.
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: application/json
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | successful operation | - |
-
-
-## getOrderById
+**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
+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;
@@ -163,29 +155,28 @@ 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");
+ 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();
- }
+ 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 |
@@ -200,25 +191,23 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: application/xml, application/json
+ - **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
+**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;
@@ -228,29 +217,28 @@ 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");
+ 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();
- }
+ 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 |
@@ -265,12 +253,12 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: application/xml, application/json
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **200** | successful operation | - |
-| **400** | Invalid Order | - |
+**200** | successful operation | - |
+**400** | Invalid Order | - |
diff --git a/samples/client/petstore/java/jersey2-java6/docs/UserApi.md b/samples/client/petstore/java/jersey2-java6/docs/UserApi.md
index ca9f550c3167..7a90fb438b19 100644
--- a/samples/client/petstore/java/jersey2-java6/docs/UserApi.md
+++ b/samples/client/petstore/java/jersey2-java6/docs/UserApi.md
@@ -14,9 +14,8 @@ Method | HTTP request | Description
[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
-
-## createUser
-
+
+# **createUser**
> createUser(body)
Create user
@@ -24,7 +23,6 @@ Create user
This can only be done by the logged in user.
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -34,28 +32,27 @@ 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");
+ 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();
- }
+ 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 |
@@ -70,23 +67,21 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: Not defined
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **0** | successful operation | - |
-
-
-## createUsersWithArrayInput
+**0** | successful operation | - |
+
+# **createUsersWithArrayInput**
> createUsersWithArrayInput(body)
Creates list of users with given input array
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -96,28 +91,27 @@ 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");
+ 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();
- }
+ 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 |
@@ -132,23 +126,21 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: Not defined
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **0** | successful operation | - |
-
-
-## createUsersWithListInput
+**0** | successful operation | - |
+
+# **createUsersWithListInput**
> createUsersWithListInput(body)
Creates list of users with given input array
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -158,28 +150,27 @@ 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");
+ 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();
- }
+ 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 |
@@ -194,17 +185,16 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: Not defined
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **0** | successful operation | - |
-
-
-## deleteUser
+**0** | successful operation | - |
+
+# **deleteUser**
> deleteUser(username)
Delete user
@@ -212,7 +202,6 @@ Delete user
This can only be done by the logged in user.
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -222,28 +211,27 @@ 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");
+ 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();
- }
+ 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 |
@@ -258,24 +246,22 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: Not defined
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **400** | Invalid username supplied | - |
-| **404** | User not found | - |
-
-
-## getUserByName
+**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;
@@ -285,29 +271,28 @@ 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");
+ 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();
- }
+ 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. |
@@ -322,25 +307,23 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: application/xml, application/json
+ - **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
+**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;
@@ -350,30 +333,29 @@ 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");
+ 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();
- }
+ 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 |
@@ -389,24 +371,22 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: application/xml, application/json
+ - **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
+**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;
@@ -416,26 +396,25 @@ 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");
+ 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();
- }
+ 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
@@ -448,17 +427,16 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: Not defined
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **0** | successful operation | - |
-
-
-## updateUser
+**0** | successful operation | - |
+
+# **updateUser**
> updateUser(username, body)
Updated user
@@ -466,7 +444,6 @@ Updated user
This can only be done by the logged in user.
### Example
-
```java
// Import classes:
import org.openapitools.client.ApiClient;
@@ -476,29 +453,28 @@ 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");
+ 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();
- }
+ 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 |
@@ -514,12 +490,12 @@ No authorization required
### HTTP request headers
-- **Content-Type**: Not defined
-- **Accept**: Not defined
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
-| **400** | Invalid user supplied | - |
-| **404** | User not found | - |
+**400** | Invalid user supplied | - |
+**404** | User not found | - |
diff --git a/samples/client/petstore/java/jersey2-java6/pom.xml b/samples/client/petstore/java/jersey2-java6/pom.xml
index 165978e4d3b2..99a1d8ff27d2 100644
--- a/samples/client/petstore/java/jersey2-java6/pom.xml
+++ b/samples/client/petstore/java/jersey2-java6/pom.xml
@@ -33,6 +33,20 @@
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.8.1
+
+ true
+ 128m
+ 512m
+
+ -Xlint:all
+ -J-Xss4m
+
+
+ org.apache.maven.pluginsmaven-enforcer-plugin
@@ -88,7 +102,7 @@
org.apache.maven.pluginsmaven-jar-plugin
- 2.6
+ 2.2
@@ -132,22 +146,6 @@
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.8.1
-
- 1.6
- 1.6
- true
- 128m
- 512m
-
- -Xlint:all
- -J-Xss4m
-
-
- org.apache.maven.pluginsmaven-javadoc-plugin
@@ -215,64 +213,38 @@
io.swaggerswagger-annotations
- ${swagger-annotations-version}
+ ${swagger-core-version}
-
com.google.code.findbugsjsr3053.0.2
-
-
- org.glassfish.jersey.core
- jersey-client
- ${jersey-version}
+ com.squareup.okhttp3
+ okhttp
+ ${okhttp-version}
- org.glassfish.jersey.media
- jersey-media-multipart
- ${jersey-version}
+ com.squareup.okhttp3
+ logging-interceptor
+ ${okhttp-version}
- org.glassfish.jersey.media
- jersey-media-json-jackson
- ${jersey-version}
-
-
-
-
- com.fasterxml.jackson.core
- jackson-core
- ${jackson-version}
+ com.google.code.gson
+ gson
+ ${gson-version}
- com.fasterxml.jackson.core
- jackson-annotations
- ${jackson-version}
+ io.gsonfire
+ gson-fire
+ ${gson-fire-version}
- com.fasterxml.jackson.core
- jackson-databind
- ${jackson-databind-version}
-
-
- org.openapitools
- jackson-databind-nullable
- ${jackson-databind-nullable-version}
-
-
- com.github.joschi.jackson
- jackson-datatype-threetenbp
- ${threetenbp-version}
-
-
-
- com.brsanthu
- migbase64
- 2.2
+ org.apache.oltu.oauth2
+ org.apache.oltu.oauth2.client
+ 1.0.1org.apache.commons
@@ -280,19 +252,14 @@
${commons-lang3-version}
- commons-io
- commons-io
- ${commons-io-version}
+ org.threeten
+ threetenbp
+ ${threetenbp-version}
- org.tomitribe
- tomitribe-http-signatures
- ${http-signature-version}
-
-
- com.github.scribejava
- scribejava-apis
- 6.9.0
+ javax.annotation
+ javax.annotation-api
+ ${javax-annotation-version}
@@ -303,16 +270,17 @@
- UTF-8
- 1.6.1
- 2.6
- 2.5
- 3.6
- 2.10.3
- 2.10.3
- 0.2.1
- 2.9.10
+ 1.6
+ ${java.version}
+ ${java.version}
+ 1.8.4
+ 1.5.24
+ 3.14.7
+ 2.8.6
+ 3.10
+ 1.4.3
+ 1.3.24.13
- 1.3
+ UTF-8
diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiCallback.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiCallback.java
new file mode 100644
index 000000000000..c10438d3c5b6
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java6/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/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java
index e4abd9b02aa0..b4072319ad5e 100644
--- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java
+++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java
@@ -1,1146 +1,1413 @@
+/*
+ * 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 javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.Invocation;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.Form;
-import javax.ws.rs.core.GenericType;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-
-import com.github.scribejava.core.model.OAuth2AccessToken;
-import org.glassfish.jersey.client.ClientConfig;
-import org.glassfish.jersey.client.ClientProperties;
-import org.glassfish.jersey.client.HttpUrlConnectorProvider;
-import org.glassfish.jersey.jackson.JacksonFeature;
-import org.glassfish.jersey.media.multipart.FormDataBodyPart;
-import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
-import org.glassfish.jersey.media.multipart.MultiPart;
-import org.glassfish.jersey.media.multipart.MultiPartFeature;
+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.net.URI;
-import org.apache.commons.io.FileUtils;
-import org.glassfish.jersey.filter.LoggingFilter;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.Date;
-
-import java.net.URLEncoder;
-
-import java.io.File;
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.HttpSignatureAuth;
import org.openapitools.client.auth.ApiKeyAuth;
import org.openapitools.client.auth.OAuth;
-import org.openapitools.client.model.AbstractOpenApiSchema;
-
+import org.openapitools.client.auth.RetryingOAuth;
+import org.openapitools.client.auth.OAuthFlow;
public class ApiClient {
- protected Map defaultHeaderMap = new HashMap();
- protected Map defaultCookieMap = new HashMap();
- protected String basePath = "http://petstore.swagger.io:80/v2";
- protected List servers = new ArrayList(Arrays.asList(
- new ServerConfiguration(
- "http://petstore.swagger.io:80/v2",
- "No description provided",
- new HashMap()
- )
- ));
- protected Integer serverIndex = 0;
- protected Map serverVariables = null;
- protected Map> operationServers = new HashMap>() {{
- }};
- protected Map operationServerIndex = new HashMap();
- protected Map> operationServerVariables = new HashMap>();
- protected boolean debugging = false;
- protected int connectionTimeout = 0;
- private int readTimeout = 0;
- protected Client httpClient;
- protected JSON json;
- protected String tempFolderPath = null;
+ 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;
- protected Map authentications;
- protected Map authenticationLookup;
+ private Map authentications;
- protected DateFormat dateFormat;
+ private DateFormat dateFormat;
+ private DateFormat datetimeFormat;
+ private boolean lenientDatetimeFormat;
+ private int dateLength;
- public ApiClient() {
- json = new JSON();
- httpClient = buildHttpClient(debugging);
+ private InputStream sslCaCert;
+ private boolean verifyingSsl;
+ private KeyManager[] keyManagers;
- this.dateFormat = new RFC3339DateFormat();
+ private OkHttpClient httpClient;
+ private JSON json;
- // Set default User-Agent.
- setUserAgent("OpenAPI-Generator/1.0.0/java");
+ private HttpLoggingInterceptor loggingInterceptor;
- // Setup authentications (key: authentication name, value: authentication).
- authentications = new HashMap();
- 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(basePath, ""));
- // Prevent the authentications from being modified.
- authentications = Collections.unmodifiableMap(authentications);
+ /*
+ * Basic constructor for ApiClient
+ */
+ public ApiClient() {
+ init();
+ initHttpClient();
- // Setup authentication lookup (key: authentication alias, value: authentication name)
- authenticationLookup = new HashMap();
- }
-
- /**
- * Gets the JSON instance to do JSON serialization and deserialization.
- *
- * @return JSON
- */
- public JSON getJSON() {
- return json;
- }
-
- public Client getHttpClient() {
- return httpClient;
- }
-
- public ApiClient setHttpClient(Client httpClient) {
- this.httpClient = httpClient;
- return this;
- }
-
- public String getBasePath() {
- return basePath;
- }
-
- public ApiClient setBasePath(String basePath) {
- this.basePath = basePath;
- setOauthBasePath(basePath);
- return this;
- }
-
- public List getServers() {
- return servers;
- }
-
- public ApiClient setServers(List servers) {
- this.servers = servers;
- updateBasePath();
- return this;
- }
-
- public Integer getServerIndex() {
- return serverIndex;
- }
-
- public ApiClient setServerIndex(Integer serverIndex) {
- this.serverIndex = serverIndex;
- updateBasePath();
- return this;
- }
-
- public Map getServerVariables() {
- return serverVariables;
- }
-
- public ApiClient setServerVariables(Map serverVariables) {
- this.serverVariables = serverVariables;
- updateBasePath();
- return this;
- }
-
- private void updateBasePath() {
- setBasePath(servers.get(serverIndex).URL(serverVariables));
- }
-
- private void setOauthBasePath(String basePath) {
- for(Authentication auth : authentications.values()) {
- if (auth instanceof OAuth) {
- ((OAuth) auth).setBasePath(basePath);
- }
- }
- }
-
- /**
- * Get authentications (key: authentication name, value: authentication).
- *
- * @return Map of authentication object
- */
- 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 ApiClient setUsername(String username) {
- for (Authentication auth : authentications.values()) {
- if (auth instanceof HttpBasicAuth) {
- ((HttpBasicAuth) auth).setUsername(username);
- return this;
- }
- }
- throw new RuntimeException("No HTTP basic authentication configured!");
- }
-
- /**
- * Helper method to set password for the first HTTP basic authentication.
- *
- * @param password Password
- */
- public ApiClient setPassword(String password) {
- for (Authentication auth : authentications.values()) {
- if (auth instanceof HttpBasicAuth) {
- ((HttpBasicAuth) auth).setPassword(password);
- return this;
- }
- }
- 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 ApiClient setApiKey(String apiKey) {
- for (Authentication auth : authentications.values()) {
- if (auth instanceof ApiKeyAuth) {
- ((ApiKeyAuth) auth).setApiKey(apiKey);
- return this;
- }
- }
- throw new RuntimeException("No API key authentication configured!");
- }
-
- /**
- * Helper method to configure authentications which respects aliases of API keys.
- *
- * @param secrets Hash map from authentication name to its secret.
- */
- public ApiClient configureApiKeys(HashMap secrets) {
- for (Map.Entry authEntry : authentications.entrySet()) {
- Authentication auth = authEntry.getValue();
- if (auth instanceof ApiKeyAuth) {
- String name = authEntry.getKey();
- // respect x-auth-id-alias property
- name = authenticationLookup.containsKey(name) ? authenticationLookup.get(name) : name;
- if (secrets.containsKey(name)) {
- ((ApiKeyAuth) auth).setApiKey(secrets.get(name));
- }
- }
- }
- return this;
- }
-
- /**
- * Helper method to set API key prefix for the first API key authentication.
- *
- * @param apiKeyPrefix API key prefix
- */
- public ApiClient setApiKeyPrefix(String apiKeyPrefix) {
- for (Authentication auth : authentications.values()) {
- if (auth instanceof ApiKeyAuth) {
- ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
- return this;
- }
- }
- throw new RuntimeException("No API key authentication configured!");
- }
-
- /**
- * Helper method to set bearer token for the first Bearer authentication.
- *
- * @param bearerToken Bearer token
- */
- public ApiClient setBearerToken(String bearerToken) {
- for (Authentication auth : authentications.values()) {
- if (auth instanceof HttpBearerAuth) {
- ((HttpBearerAuth) auth).setBearerToken(bearerToken);
- return this;
- }
- }
- throw new RuntimeException("No Bearer authentication configured!");
- }
-
-
- /**
- * Helper method to set access token for the first OAuth2 authentication.
- * @param accessToken Access token
- */
- public ApiClient setAccessToken(String accessToken) {
- for (Authentication auth : authentications.values()) {
- if (auth instanceof OAuth) {
- ((OAuth) auth).setAccessToken(accessToken);
- return this;
- }
- }
- throw new RuntimeException("No OAuth2 authentication configured!");
- }
-
- /**
- * Helper method to set the credentials for the first OAuth2 authentication.
- *
- * @param clientId the client ID
- * @param clientSecret the client secret
- */
- public ApiClient setOauthCredentials(String clientId, String clientSecret) {
- for (Authentication auth : authentications.values()) {
- if (auth instanceof OAuth) {
- ((OAuth) auth).setCredentials(clientId, clientSecret);
- return this;
- }
- }
- throw new RuntimeException("No OAuth2 authentication configured!");
- }
-
- /**
- * Helper method to set the password flow for the first OAuth2 authentication.
- *
- * @param username the user name
- * @param password the user password
- */
- public ApiClient setOauthPasswordFlow(String username, String password) {
- for (Authentication auth : authentications.values()) {
- if (auth instanceof OAuth) {
- ((OAuth) auth).usePasswordFlow(username, password);
- return this;
- }
- }
- throw new RuntimeException("No OAuth2 authentication configured!");
- }
-
- /**
- * Helper method to set the authorization code flow for the first OAuth2 authentication.
- *
- * @param code the authorization code
- */
- public ApiClient setOauthAuthorizationCodeFlow(String code) {
- for (Authentication auth : authentications.values()) {
- if (auth instanceof OAuth) {
- ((OAuth) auth).useAuthorizationCodeFlow(code);
- return this;
- }
- }
- throw new RuntimeException("No OAuth2 authentication configured!");
- }
-
- /**
- * Helper method to set the scopes for the first OAuth2 authentication.
- *
- * @param scope the oauth scope
- */
- public ApiClient setOauthScope(String scope) {
- for (Authentication auth : authentications.values()) {
- if (auth instanceof OAuth) {
- ((OAuth) auth).setScope(scope);
- return this;
- }
- }
- throw new RuntimeException("No OAuth2 authentication configured!");
- }
-
- /**
- * Set the User-Agent header's value (by adding to the default header map).
- * @param userAgent Http user agent
- * @return API client
- */
- public ApiClient setUserAgent(String userAgent) {
- addDefaultHeader("User-Agent", userAgent);
- return this;
- }
-
- /**
- * Add a default header.
- *
- * @param key The header's key
- * @param value The header's value
- * @return API client
- */
- public ApiClient addDefaultHeader(String key, String value) {
- defaultHeaderMap.put(key, value);
- return this;
- }
-
- /**
- * Add a default cookie.
- *
- * @param key The cookie's key
- * @param value The cookie's value
- * @return API client
- */
- 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 switched on
- */
- public boolean isDebugging() {
- return debugging;
- }
-
- /**
- * Enable/disable debugging for this API client.
- *
- * @param debugging To enable (true) or disable (false) debugging
- * @return API client
- */
- public ApiClient setDebugging(boolean debugging) {
- this.debugging = debugging;
- // Rebuild HTTP Client according to the new "debugging" value.
- this.httpClient = buildHttpClient(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.
- *
- * @return Temp folder path
- */
- public String getTempFolderPath() {
- return tempFolderPath;
- }
-
- /**
- * Set temp folder path
- * @param tempFolderPath Temp folder path
- * @return API client
- */
- public ApiClient setTempFolderPath(String tempFolderPath) {
- this.tempFolderPath = tempFolderPath;
- return this;
- }
-
- /**
- * Connect timeout (in milliseconds).
- * @return Connection timeout
- */
- public int getConnectTimeout() {
- return connectionTimeout;
- }
-
- /**
- * Set the connect timeout (in milliseconds).
- * A value of 0 means no timeout, otherwise values must be between 1 and
- * {@link Integer#MAX_VALUE}.
- * @param connectionTimeout Connection timeout in milliseconds
- * @return API client
- */
- public ApiClient setConnectTimeout(int connectionTimeout) {
- this.connectionTimeout = connectionTimeout;
- httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout);
- return this;
- }
-
- /**
- * read timeout (in milliseconds).
- * @return Read timeout
- */
- public int getReadTimeout() {
- return readTimeout;
- }
-
- /**
- * Set 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) {
- this.readTimeout = readTimeout;
- httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout);
- return this;
- }
-
- /**
- * Get the date format used to parse/format date parameters.
- * @return Date format
- */
- public DateFormat getDateFormat() {
- return dateFormat;
- }
-
- /**
- * Set the date format used to parse/format date parameters.
- * @param dateFormat Date format
- * @return API client
- */
- public ApiClient setDateFormat(DateFormat dateFormat) {
- this.dateFormat = dateFormat;
- // also set the date format for model (de)serialization with Date properties
- this.json.setDateFormat((DateFormat) dateFormat.clone());
- return this;
- }
-
- /**
- * Parse the given string into Date object.
- * @param str String
- * @return Date
- */
- public Date parseDate(String str) {
- try {
- return dateFormat.parse(str);
- } catch (java.text.ParseException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Format the given Date object into string.
- * @param date Date
- * @return Date in string format
- */
- public String formatDate(Date date) {
- return dateFormat.format(date);
- }
-
- /**
- * Format the given parameter object into string.
- * @param param Object
- * @return Object in string format
- */
- public String parameterToString(Object param) {
- if (param == null) {
- return "";
- } else if (param instanceof Date) {
- return formatDate((Date) param);
- } 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);
- }
- }
-
- /*
- * Format to {@code Pair} objects.
- * @param collectionFormat Collection format
- * @param name Name
- * @param value Value
- * @return List of pairs
- */
- public List parameterToPairs(String collectionFormat, String name, Object value){
- List params = new ArrayList();
-
- // preconditions
- if (name == null || name.isEmpty() || value == null) return params;
-
- Collection valueCollection;
- if (value instanceof Collection) {
- valueCollection = (Collection) value;
- } else {
- params.add(new Pair(name, parameterToString(value)));
- return params;
+ // 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);
}
- if (valueCollection.isEmpty()){
- return params;
+ /*
+ * Constructor for ApiClient to support access token retry on 401/403 configured with client ID
+ */
+ public ApiClient(String clientId) {
+ this(clientId, null, null);
}
- // get the collection format (default: csv)
- String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat);
-
- // create the params based on the collection format
- if ("multi".equals(format)) {
- for (Object item : valueCollection) {
- params.add(new Pair(name, parameterToString(item)));
- }
-
- return params;
+ /*
+ * 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);
}
- String delimiter = ",";
-
- if ("csv".equals(format)) {
- delimiter = ",";
- } else if ("ssv".equals(format)) {
- delimiter = " ";
- } else if ("tsv".equals(format)) {
- delimiter = "\t";
- } else if ("pipes".equals(format)) {
- delimiter = "|";
+ /*
+ * 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);
}
- StringBuilder sb = new StringBuilder() ;
- for (Object item : valueCollection) {
- sb.append(delimiter);
- sb.append(parameterToString(item));
- }
-
- params.add(new Pair(name, sb.substring(1)));
-
- return params;
- }
-
- /**
- * 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
- * @return True if the MIME type is JSON
- */
- 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,
- * JSON will be used.
- */
- public String selectHeaderContentType(String[] contentTypes) {
- if (contentTypes.length == 0) {
- 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
- * @return Escaped string
- */
- public String escapeString(String str) {
- try {
- return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20");
- } catch (UnsupportedEncodingException e) {
- return str;
- }
- }
-
- /**
- * Serialize the given Java object into string entity according the given
- * Content-Type (only JSON is supported for now).
- * @param obj Object
- * @param formParams Form parameters
- * @param contentType Context type
- * @return Entity
- * @throws ApiException API exception
- */
- public Entity> serialize(Object obj, Map formParams, String contentType) throws ApiException {
- Entity> entity;
- if (contentType.startsWith("multipart/form-data")) {
- MultiPart multiPart = new MultiPart();
- for (Entry param: formParams.entrySet()) {
- if (param.getValue() instanceof File) {
- File file = (File) param.getValue();
- FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey())
- .fileName(file.getName()).size(file.length()).build();
- multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE));
- } else {
- FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build();
- multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue())));
- }
- }
- entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE);
- } else if (contentType.startsWith("application/x-www-form-urlencoded")) {
- Form form = new Form();
- for (Entry param: formParams.entrySet()) {
- form.param(param.getKey(), parameterToString(param.getValue()));
- }
- entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE);
- } else {
- // We let jersey handle the serialization
- entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType);
- }
- return entity;
- }
-
- /**
- * Serialize the given Java object into string according the given
- * Content-Type (only JSON, HTTP form is supported for now).
- * @param obj Object
- * @param formParams Form parameters
- * @param contentType Context type
- * @return String
- * @throws ApiException API exception
- */
- public String serializeToString(Object obj, Map formParams, String contentType) throws ApiException {
- try {
- if (contentType.startsWith("multipart/form-data")) {
- throw new ApiException("multipart/form-data not yet supported for serializeToString (http signature authentication)");
- } else if (contentType.startsWith("application/x-www-form-urlencoded")) {
- String formString = "";
- for (Entry param : formParams.entrySet()) {
- formString = param.getKey() + "=" + URLEncoder.encode(parameterToString(param.getValue()), "UTF-8") + "&";
+ /*
+ * 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;
}
- if (formString.length() == 0) { // empty string
- return formString;
- } else {
- return formString.substring(0, formString.length() - 1);
+ 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");
+ }
}
- } else {
- return json.getMapper().writeValueAsString(obj);
- }
- } catch (Exception ex) {
- throw new ApiException("Failed to perform serializeToString: " + ex.toString());
- }
- }
+ 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());
- public AbstractOpenApiSchema deserializeSchemas(Response response, AbstractOpenApiSchema schema) throws ApiException{
-
- Object result = null;
- int matchCounter = 0;
- ArrayList matchSchemas = new ArrayList<>();
-
- if (schema.isNullable()) {
- response.bufferEntity();
- if ("{}".equals(String.valueOf(response.readEntity(String.class))) ||
- "".equals(String.valueOf(response.readEntity(String.class)))) {
- // schema is nullable and the response body is {} or empty string
- return schema;
- }
+ // Prevent the authentications from being modified.
+ authentications = Collections.unmodifiableMap(authentications);
}
- for (Map.Entry entry : schema.getSchemas().entrySet()) {
- String schemaName = entry.getKey();
- GenericType schemaType = entry.getValue();
+ private void initHttpClient() {
+ initHttpClient(Collections.emptyList());
+ }
- if (schemaType instanceof GenericType) { // model
- try {
- Object deserializedObject = deserialize(response, schemaType);
- if (deserializedObject != null) {
- result = deserializedObject;
- matchCounter++;
+ private void initHttpClient(List interceptors) {
+ OkHttpClient.Builder builder = new OkHttpClient.Builder();
+ builder.addNetworkInterceptor(getProgressInterceptor());
+ for (Interceptor interceptor: interceptors) {
+ builder.addInterceptor(interceptor);
+ }
- if ("anyOf".equals(schema.getSchemaType())) {
- break;
- } else if ("oneOf".equals(schema.getSchemaType())) {
- matchSchemas.add(schemaName);
+ 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();
+ }
+
+ /**
+ * 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 {
- throw new ApiException("Unknowe type found while expecting anyOf/oneOf:" + schema.getSchemaType());
+ httpClient.interceptors().remove(loggingInterceptor);
+ loggingInterceptor = null;
}
- } else {
- // failed to deserialize the response in the schema provided, proceed to the next one if any
- }
- } catch (Exception ex) {
- // failed to deserialize, do nothing and try next one (schema)
}
- } else {// unknown type
- throw new ApiException(schemaType.getClass() + " is not a GenericType and cannot be handled properly in deserialization.");
- }
-
+ this.debugging = debugging;
+ return this;
}
- if (matchCounter > 1 && "oneOf".equals(schema.getSchemaType())) {// more than 1 match for oneOf
- throw new ApiException("Response body is invalid as it matches more than one schema (" + StringUtil.join(matchSchemas, ", ") + ") defined in the oneOf model: " + schema.getClass().getName());
- } else if (matchCounter == 0) { // fail to match any in oneOf/anyOf schemas
- throw new ApiException("Response body is invalid as it doens't match any schemas (" + StringUtil.join(schema.getSchemas().keySet(), ", ") + ") defined in the oneOf/anyOf model: " + schema.getClass().getName());
- } else { // only one matched
- schema.setActualInstance(result);
- return schema;
+ /**
+ * 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;
}
- }
-
-
-
- /**
- * Deserialize response body to Java object according to the Content-Type.
- * @param Type
- * @param response Response
- * @param returnType Return type
- * @return Deserialize object
- * @throws ApiException API exception
- */
- @SuppressWarnings("unchecked")
- public T deserialize(Response response, GenericType returnType) throws ApiException {
- if (response == null || returnType == null) {
- return null;
+ /**
+ * 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;
}
- if ("byte[]".equals(returnType.toString())) {
- // Handle binary response (byte array).
- return (T) response.readEntity(byte[].class);
- } else if (returnType.getRawType() == File.class) {
- // Handle file downloading.
- T file = (T) downloadFileFromResponse(response);
- return file;
+ /**
+ * Get connection timeout (in milliseconds).
+ *
+ * @return Timeout in milliseconds
+ */
+ public int getConnectTimeout() {
+ return httpClient.connectTimeoutMillis();
}
- String contentType = null;
- List