-[](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22) [](./LICENSE)  [](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM) [](https://twitter.com/oas_generator)
+[](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22) [](./LICENSE) [](https://opencollective.com/openapi_generator) [](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM) [](https://twitter.com/oas_generator)
@@ -998,7 +998,7 @@ If you want to join the committee, please kindly apply by sending an email to te
#### Members of Technical Committee
-| Languages | Member (join date) |
+| Languages/Generators | Member (join date) |
| :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ActionScript | |
| Ada | @stcarrez (2018/02) @michelealbano (2018/02) |
@@ -1020,6 +1020,7 @@ If you want to join the committee, please kindly apply by sending an email to te
| Groovy | |
| Haskell | |
| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @nmuesch (2021/01) |
+| JMeter | @kannkyo (2021/01) |
| Kotlin | @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03) |
| Lua | @daurnimator (2017/08) |
| Nim | |
diff --git a/bin/configs/java-jersey2-java8-localdatetime.yaml b/bin/configs/java-jersey2-java8-localdatetime.yaml
new file mode 100644
index 000000000000..efa977d08a3b
--- /dev/null
+++ b/bin/configs/java-jersey2-java8-localdatetime.yaml
@@ -0,0 +1,11 @@
+generatorName: java
+outputDir: samples/client/petstore/java/jersey2-java8-localdatetime
+library: jersey2
+inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+additionalProperties:
+ artifactId: petstore-jersey2-java8-localdatetime
+ hideGenerationTimestamp: "true"
+ dateLibrary: java8-localdatetime
+ java8: true
+ delegatePattern: true
diff --git a/bin/configs/rust-server-petstore-with-fake-endpoints-models-for-testing.yaml b/bin/configs/rust-server-petstore-with-fake-endpoints-models-for-testing.yaml
index c0f47a60634f..7e009c7d9529 100644
--- a/bin/configs/rust-server-petstore-with-fake-endpoints-models-for-testing.yaml
+++ b/bin/configs/rust-server-petstore-with-fake-endpoints-models-for-testing.yaml
@@ -6,3 +6,4 @@ generateAliasAsModel: true
additionalProperties:
hideGenerationTimestamp: "true"
packageName: petstore-with-fake-endpoints-models-for-testing
+ publishRustRegistry: crates-io
diff --git a/bin/configs/rust-server-ping-bearer-auth-v3.yaml b/bin/configs/rust-server-ping-bearer-auth-v3.yaml
new file mode 100644
index 000000000000..5f02e791e1a4
--- /dev/null
+++ b/bin/configs/rust-server-ping-bearer-auth-v3.yaml
@@ -0,0 +1,8 @@
+generatorName: rust-server
+outputDir: samples/server/petstore/rust-server/output/ping-bearer-auth
+inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/ping-bearer-auth.yaml
+templateDir: modules/openapi-generator/src/main/resources/rust-server
+generateAliasAsModel: true
+additionalProperties:
+ hideGenerationTimestamp: "true"
+ packageName: ping-bearer-auth
diff --git a/bin/utils/export_docs_generators.sh b/bin/utils/export_docs_generators.sh
index a456f275f8f3..6417629c7d8f 100755
--- a/bin/utils/export_docs_generators.sh
+++ b/bin/utils/export_docs_generators.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
SCRIPT="$0"
echo "# START SCRIPT: ${SCRIPT}"
@@ -17,4 +17,4 @@ do
((i=i%N)); ((i++==0)) && wait
./bin/utils/export_generator.sh ${GENERATOR} &
done
-)
\ No newline at end of file
+)
diff --git a/bin/utils/export_generator.sh b/bin/utils/export_generator.sh
index a566522a90b8..8a54d77555a5 100755
--- a/bin/utils/export_generator.sh
+++ b/bin/utils/export_generator.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
SCRIPT="$0"
diff --git a/docs/generators/cpp-qt5-client.md b/docs/generators/cpp-qt5-client.md
index ada59e68cea1..282c674f9edd 100644
--- a/docs/generators/cpp-qt5-client.md
+++ b/docs/generators/cpp-qt5-client.md
@@ -206,7 +206,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|XMLStructureDefinitions|✗|OAS2,OAS3
|MultiServer|✓|OAS3
|ParameterizedServer|✓|OAS3
-|ParameterStyling|✗|OAS3
+|ParameterStyling|✓|OAS3
|Callbacks|✗|OAS3
|LinkObjects|✗|OAS3
diff --git a/docs/generators/python-aiohttp.md b/docs/generators/python-aiohttp.md
index 1eb75a73aa4b..ded84c55242f 100644
--- a/docs/generators/python-aiohttp.md
+++ b/docs/generators/python-aiohttp.md
@@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|defaultController|default controller| |default_controller|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
+|featureCORS|use flask-cors for handling CORS requests| |false|
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**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|
|packageName|python package name (convention: snake_case).| |openapi_server|
|packageVersion|python package version.| |1.0.0|
diff --git a/docs/generators/python-blueplanet.md b/docs/generators/python-blueplanet.md
index dba4b0a0072f..eb4fdab9aa1c 100644
--- a/docs/generators/python-blueplanet.md
+++ b/docs/generators/python-blueplanet.md
@@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|defaultController|default controller| |default_controller|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
+|featureCORS|use flask-cors for handling CORS requests| |false|
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**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|
|packageName|python package name (convention: snake_case).| |openapi_server|
|packageVersion|python package version.| |1.0.0|
diff --git a/docs/generators/python-flask.md b/docs/generators/python-flask.md
index 4811927404a0..a0b17be64828 100644
--- a/docs/generators/python-flask.md
+++ b/docs/generators/python-flask.md
@@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|defaultController|default controller| |default_controller|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
+|featureCORS|use flask-cors for handling CORS requests| |false|
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**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|
|packageName|python package name (convention: snake_case).| |openapi_server|
|packageVersion|python package version.| |1.0.0|
diff --git a/docs/generators/rust-server.md b/docs/generators/rust-server.md
index cadccd0fbccd..1d13b0321041 100644
--- a/docs/generators/rust-server.md
+++ b/docs/generators/rust-server.md
@@ -196,7 +196,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|BasicAuth|✓|OAS2,OAS3
|ApiKey|✓|OAS2,OAS3
|OpenIDConnect|✗|OAS3
-|BearerToken|✗|OAS3
+|BearerToken|✓|OAS3
|OAuth2_Implicit|✓|OAS2,OAS3
|OAuth2_Password|✗|OAS2,OAS3
|OAuth2_ClientCredentials|✗|OAS2,OAS3
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java
index e1acbc1e1665..e9195a684b6e 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java
@@ -49,6 +49,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodege
public static final String CONTROLLER_PACKAGE = "controllerPackage";
public static final String DEFAULT_CONTROLLER = "defaultController";
public static final String SUPPORT_PYTHON2 = "supportPython2";
+ public static final String FEATURE_CORS = "featureCORS";
// nose is a python testing framework, we use pytest if USE_NOSE is unset
public static final String USE_NOSE = "useNose";
public static final String PYTHON_SRC_ROOT = "pythonSrcRoot";
@@ -61,6 +62,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodege
protected String defaultController;
protected Map regexModifiers;
protected boolean fixBodyName;
+ protected boolean featureCORS = Boolean.FALSE;
protected boolean useNose = Boolean.FALSE;
protected String pythonSrcRoot;
@@ -165,6 +167,8 @@ public AbstractPythonConnexionServerCodegen(String templateDirectory, boolean fi
defaultValue("false"));
cliOptions.add(new CliOption("serverPort", "TCP port to listen to in app.run").
defaultValue("8080"));
+ cliOptions.add(CliOption.newBoolean(FEATURE_CORS, "use flask-cors for handling CORS requests").
+ defaultValue(Boolean.FALSE.toString()));
cliOptions.add(CliOption.newBoolean(USE_NOSE, "use the nose test framework").
defaultValue(Boolean.FALSE.toString()));
cliOptions.add(new CliOption(PYTHON_SRC_ROOT, "put python sources in this subdirectory of output folder (defaults to \"\" for). Use this for src/ layout.").
@@ -213,6 +217,9 @@ public void processOpts() {
additionalProperties.put(SUPPORT_PYTHON2, Boolean.TRUE);
typeMapping.put("long", "long");
}
+ if (additionalProperties.containsKey(FEATURE_CORS)) {
+ setFeatureCORS((String) additionalProperties.get(FEATURE_CORS));
+ }
if (additionalProperties.containsKey(USE_NOSE)) {
setUseNose((String) additionalProperties.get(USE_NOSE));
}
@@ -236,6 +243,10 @@ public void processOpts() {
controllerPackage = packageName + "." + controllerPackage;
}
+ public void setFeatureCORS(String val) {
+ this.featureCORS = Boolean.valueOf(val);
+ }
+
public void setUseNose(String val) {
this.useNose = Boolean.valueOf(val);
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java
index 7a383a1e87eb..bda75d399c29 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java
@@ -46,6 +46,7 @@ public CppQt5ClientCodegen() {
.includeSecurityFeatures(SecurityFeature.BasicAuth)
.includeSecurityFeatures(SecurityFeature.ApiKey)
.includeSecurityFeatures(SecurityFeature.BearerToken)
+ .includeGlobalFeatures(GlobalFeature.ParameterStyling)
);
// set the output folder here
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 3dd6dddbf69b..687f773f7a98 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
@@ -338,7 +338,8 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml"));
}
- if (dateLibrary.equals("java8") && (isLibrary(WEBCLIENT) || isLibrary(VERTX) || isLibrary(RESTTEMPLATE) || isLibrary(RESTEASY) || isLibrary(MICROPROFILE) || isLibrary(JERSEY2))) {
+ // helper for client library that allow to parse/format java.time.OffsetDateTime or org.threeten.bp.OffsetDateTime
+ if (additionalProperties.containsKey("jsr310") && (isLibrary(WEBCLIENT) || isLibrary(VERTX) || isLibrary(RESTTEMPLATE) || isLibrary(RESTEASY) || isLibrary(MICROPROFILE) || isLibrary(JERSEY1) || isLibrary(JERSEY2))) {
supportingFiles.add(new SupportingFile("JavaTimeFormatter.mustache", invokerFolder, "JavaTimeFormatter.java"));
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java
index 534c5248293c..d0d3fd79d436 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java
@@ -566,9 +566,14 @@ public void postProcessParameter(CodegenParameter p) {
}
}
- private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel result) {
+ private void fixComposedSchemaRequiredVars(Schema schema, CodegenModel result) {
// for composed schema models, if the required properties are only from oneOf or anyOf models
- // give them a nulltype.Null so the user can omit including them in python
+ // remove them from the composed schema's required vars
+ // for composed schemas our code adds oneOf and anyOf required properties to
+ // the composed schema's required properties
+ // but they should not be required because if we have ComposedSchema: oneOf -schemaA -schemaB
+ // and the required props are only in schemaB, we do not need to use them when making an instance of
+ // ComposedSchema + schemaA
ComposedSchema cs = (ComposedSchema) schema;
// these are the properties that are from properties in self cs or cs allOf
@@ -596,7 +601,7 @@ private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel resu
List allOf = cs.getAllOf();
if ((schema.getProperties() != null && !schema.getProperties().isEmpty()) || allOf != null) {
- // NOTE: this function also adds the allOf propesrties inside schema
+ // NOTE: this function also adds the allOf properties inside schema
addProperties(selfProperties, selfRequired, schema);
}
if (result.discriminator != null) {
@@ -605,16 +610,20 @@ private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel resu
Set selfRequiredSet = new HashSet(selfRequired);
List reqVars = result.getRequiredVars();
+ List reqVarsThatMustBeOptional = new ArrayList<>();
if (reqVars != null) {
for (CodegenProperty cp : reqVars) {
String propName = cp.baseName;
if (otherRequiredSet.contains(propName) && !selfRequiredSet.contains(propName)) {
- // if var is in otherRequiredSet and is not in selfRequiredSet and is in result.requiredVars
- // then set it to nullable because the user doesn't have to give a value for it
- cp.setDefaultValue("nulltype.Null");
+ cp.required = false;
+ reqVarsThatMustBeOptional.add(cp);
}
}
}
+ for (CodegenProperty cp : reqVarsThatMustBeOptional) {
+ result.getRequiredVars().remove(cp);
+ result.getOptionalVars().add(cp);
+ }
}
/**
@@ -643,7 +652,7 @@ protected void addParentContainer(CodegenModel model, String name, Schema schema
public CodegenModel fromModel(String name, Schema sc) {
CodegenModel cm = super.fromModel(name, sc);
if (cm.requiredVars.size() > 0 && (cm.oneOf.size() > 0 || cm.anyOf.size() > 0)) {
- addNullDefaultToOneOfAnyOfReqProps(sc, cm);
+ fixComposedSchemaRequiredVars(sc, cm);
}
ArrayList> listOfLists = new ArrayList>();
listOfLists.add(cm.requiredVars);
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java
index bc9ee0f8432b..74cfe07f1f09 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java
@@ -732,7 +732,11 @@ public String constructExampleCode(CodegenProperty codegenProperty, HashMap) codegenProperty.allowableValues.get("values")).get(0)) + "\"";
+ } else {
+ return "\"" + codegenProperty.name + "_example\"";
+ }
}
} else { // numeric
if (StringUtils.isEmpty(codegenProperty.example)) {
@@ -756,9 +760,16 @@ public String constructExampleCode(CodegenModel codegenModel, HashMap propertyExamples = new ArrayList<>();
- for (CodegenProperty codegenProperty : codegenModel.vars) {
+ // required properties first
+ for (CodegenProperty codegenProperty : codegenModel.requiredVars) {
propertyExamples.add(constructExampleCode(codegenProperty, modelMaps));
}
+
+ // optional properties second
+ for (CodegenProperty codegenProperty : codegenModel.optionalVars) {
+ propertyExamples.add(constructExampleCode(codegenProperty, modelMaps));
+ }
+
example += StringUtils.join(propertyExamples, ", ");
example += ")";
return example;
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java
index 2080fca66a72..7a1b22b20c4e 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java
@@ -94,6 +94,7 @@ public RustServerCodegen() {
.securityFeatures(EnumSet.of(
SecurityFeature.ApiKey,
SecurityFeature.BasicAuth,
+ SecurityFeature.BearerToken,
SecurityFeature.OAuth2_Implicit
))
.excludeGlobalFeatures(
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java
index bb86edadfefe..796a005260f6 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java
@@ -140,6 +140,8 @@ public Swift5ClientCodegen() {
// Added for Objective-C compatibility
"id", "description", "NSArray", "NSURL", "CGFloat", "NSSet", "NSString", "NSInteger", "NSUInteger",
"NSError", "NSDictionary",
+ // 'Property 'hash' with type 'String' cannot override a property with type 'Int' (when objcCompatible=true)
+ "hash",
// Cannot override with a stored property 'className'
"className"
)
diff --git a/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache
index 262110a2992c..d75e455961c5 100644
--- a/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache
@@ -12,7 +12,9 @@ import com.fasterxml.jackson.datatype.joda.JodaModule;
{{/joda}}
{{#java8}}
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
+{{^threetenbp}}
import java.time.OffsetDateTime;
+{{/threetenbp}}
{{/java8}}
{{#threetenbp}}
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
@@ -68,7 +70,7 @@ import {{invokerPackage}}.auth.OAuth;
{{/hasOAuthMethods}}
{{>generatedAnnotation}}
-public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
+public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
private Map defaultHeaderMap = new HashMap();
private Map defaultCookieMap = new HashMap();
private String basePath = "{{{basePath}}}";
@@ -500,9 +502,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
return "";
} else if (param instanceof Date) {
return formatDate((Date) param);
- } {{#java8}}else if (param instanceof OffsetDateTime) {
+ } {{#jsr310}}else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param);
- } {{/java8}}else if (param instanceof Collection) {
+ } {{/jsr310}}else if (param instanceof Collection) {
StringBuilder b = new StringBuilder();
for(Object o : (Collection>)param) {
if(b.length() > 0) {
diff --git a/modules/openapi-generator/src/main/resources/Java/JavaTimeFormatter.mustache b/modules/openapi-generator/src/main/resources/Java/JavaTimeFormatter.mustache
index f3fb34e559cc..07d0eb6ce729 100644
--- a/modules/openapi-generator/src/main/resources/Java/JavaTimeFormatter.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/JavaTimeFormatter.mustache
@@ -1,9 +1,16 @@
{{>licenseInfo}}
package {{invokerPackage}};
+{{^threetenbp}}
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
+{{/threetenbp}}
+{{#threetenbp}}
+import org.threeten.bp.OffsetDateTime;
+import org.threeten.bp.format.DateTimeFormatter;
+import org.threeten.bp.format.DateTimeParseException;
+{{/threetenbp}}
/**
* Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class.
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache
index 69727cd0ace4..294949c6c770 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache
@@ -49,9 +49,14 @@ import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Date;
-{{#java8}}
+{{#jsr310}}
+{{#threetenbp}}
+import org.threeten.bp.OffsetDateTime;
+{{/threetenbp}}
+{{^threetenbp}}
import java.time.OffsetDateTime;
-{{/java8}}
+{{/threetenbp}}
+{{/jsr310}}
import java.net.URLEncoder;
@@ -74,7 +79,7 @@ import {{invokerPackage}}.auth.OAuth;
{{/hasOAuthMethods}}
{{>generatedAnnotation}}
-public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
+public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
protected Map defaultHeaderMap = new HashMap();
protected Map defaultCookieMap = new HashMap();
protected String basePath = "{{{basePath}}}";
@@ -714,9 +719,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
return "";
} else if (param instanceof Date) {
return formatDate((Date) param);
- } {{#java8}}else if (param instanceof OffsetDateTime) {
+ } {{#jsr310}}else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param);
- } {{/java8}}else if (param instanceof Collection) {
+ } {{/jsr310}}else if (param instanceof Collection) {
StringBuilder b = new StringBuilder();
for(Object o : (Collection)param) {
if(b.length() > 0) {
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache
index a4489c1e8d17..f361ff551cdb 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache
@@ -22,9 +22,14 @@ import java.util.Map.Entry;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-{{#java8}}
+{{#jsr310}}
+{{#threetenbp}}
+import org.threeten.bp.OffsetDateTime;
+{{/threetenbp}}
+{{^threetenbp}}
import java.time.OffsetDateTime;
-{{/java8}}
+{{/threetenbp}}
+{{/jsr310}}
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
@@ -51,7 +56,7 @@ import {{invokerPackage}}.auth.OAuth;
{{/hasOAuthMethods}}
{{>generatedAnnotation}}
-public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
+public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
private Map defaultHeaderMap = new HashMap();
private Map defaultCookieMap = new HashMap();
private String basePath = "{{{basePath}}}";
@@ -336,9 +341,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
return "";
} else if (param instanceof Date) {
return formatDate((Date) param);
- } {{#java8}}else if (param instanceof OffsetDateTime) {
+ } {{#jsr310}}else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param);
- } {{/java8}}else if (param instanceof Collection) {
+ } {{/jsr310}}else if (param instanceof Collection) {
StringBuilder b = new StringBuilder();
for(Object o : (Collection)param) {
if(b.length() > 0) {
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache
index 315fcdd44157..150f3d3ebbbc 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache
@@ -66,9 +66,9 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TimeZone;
-{{#java8}}
+{{#jsr310}}{{^threetenbp}}
import java.time.OffsetDateTime;
-{{/java8}}
+{{/threetenbp}}{{/jsr310}}
import {{invokerPackage}}.auth.Authentication;
{{#hasHttpBasicMethods}}
@@ -86,7 +86,7 @@ import {{invokerPackage}}.auth.OAuth;
{{>generatedAnnotation}}
@Component("{{invokerPackage}}.ApiClient")
-public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
+public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
public enum CollectionFormat {
CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null);
@@ -407,9 +407,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
return "";
} else if (param instanceof Date) {
return formatDate( (Date) param);
- } {{#java8}}else if (param instanceof OffsetDateTime) {
+ } {{#jsr310}}else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param);
- } {{/java8}}else if (param instanceof Collection) {
+ } {{/jsr310}}else if (param instanceof Collection) {
StringBuilder b = new StringBuilder();
for(Object o : (Collection>) param) {
if(b.length() > 0) {
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache
index 83b6e863ae28..95951e3c06af 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache
@@ -33,9 +33,14 @@ import io.vertx.ext.web.client.HttpResponse;
import io.vertx.ext.web.client.WebClient;
import io.vertx.ext.web.client.WebClientOptions;
-{{#java8}}
+{{#jsr310}}
+{{#threetenbp}}
+import org.threeten.bp.OffsetDateTime;
+{{/threetenbp}}
+{{^threetenbp}}
import java.time.OffsetDateTime;
-{{/java8}}
+{{/threetenbp}}
+{{/jsr310}}
import java.text.DateFormat;
import java.util.*;
import java.util.function.Consumer;
@@ -45,7 +50,7 @@ import java.util.regex.Pattern;
import static java.util.stream.Collectors.toMap;
{{>generatedAnnotation}}
-public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
+public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
private static final Pattern CONTENT_DISPOSITION_PATTERN = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
private static final OpenOptions FILE_DOWNLOAD_OPTIONS = new OpenOptions().setCreate(true).setTruncateExisting(true);
@@ -298,9 +303,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
return "";
} else if (param instanceof Date) {
return formatDate((Date) param);
- } {{#java8}}else if (param instanceof OffsetDateTime) {
+ } {{#jsr310}}else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param);
- } {{/java8}}else if (param instanceof Collection) {
+ } {{/jsr310}}else if (param instanceof Collection) {
StringBuilder b = new StringBuilder();
for (Object o : (Collection) param) {
if (b.length() > 0) {
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache
index dcd72c7e113b..4d951239ea2a 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache
@@ -59,9 +59,14 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TimeZone;
-{{#java8}}
+{{#jsr310}}
+{{#threetenbp}}
+import org.threeten.bp.OffsetDateTime;
+{{/threetenbp}}
+{{^threetenbp}}
import java.time.OffsetDateTime;
-{{/java8}}
+{{/threetenbp}}
+{{/jsr310}}
import {{invokerPackage}}.auth.Authentication;
import {{invokerPackage}}.auth.HttpBasicAuth;
@@ -72,7 +77,7 @@ import {{invokerPackage}}.auth.OAuth;
{{/hasOAuthMethods}}
{{>generatedAnnotation}}
-public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
+public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
public enum CollectionFormat {
CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null);
@@ -357,9 +362,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
return "";
} else if (param instanceof Date) {
return formatDate( (Date) param);
- } {{#java8}}else if (param instanceof OffsetDateTime) {
+ } {{#jsr310}}else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param);
- } {{/java8}}else if (param instanceof Collection) {
+ } {{/jsr310}}else if (param instanceof Collection) {
StringBuilder b = new StringBuilder();
for(Object o : (Collection>) param) {
if(b.length() > 0) {
diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/ServerConfiguration.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/ServerConfiguration.mustache
index 87bf899487c0..d4bd3526316e 100644
--- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/ServerConfiguration.mustache
+++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/ServerConfiguration.mustache
@@ -7,6 +7,7 @@
#include
#include
#include
+#include
#include "{{prefix}}ServerVariable.h"
{{#cppNamespaceDeclarations}}
diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache
index fb48260ace73..42c30bfba386 100644
--- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache
+++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache
@@ -139,15 +139,73 @@ void {{classname}}::abortRequests(){
emit abortRequestsSignal();
}
+QString {{classname}}::getParamStylePrefix(QString style){
+
+ if(style == "matrix"){
+ return ";";
+ }else if(style == "label"){
+ return ".";
+ }else if(style == "form"){
+ return "&";
+ }else if(style == "simple"){
+ return "";
+ }else if(style == "spaceDelimited"){
+ return "&";
+ }else if(style == "pipeDelimited"){
+ return "&";
+ }else
+ return "none";
+}
+
+QString {{classname}}::getParamStyleSuffix(QString style){
+
+ if(style == "matrix"){
+ return "=";
+ }else if(style == "label"){
+ return "";
+ }else if(style == "form"){
+ return "=";
+ }else if(style == "simple"){
+ return "";
+ }else if(style == "spaceDelimited"){
+ return "=";
+ }else if(style == "pipeDelimited"){
+ return "=";
+ }else
+ return "none";
+}
+
+QString {{classname}}::getParamStyleDelimiter(QString style, QString name, bool isExplode){
+
+ if(style == "matrix"){
+ return (isExplode) ? ";" + name + "=" : ",";
+
+ }else if(style == "label"){
+ return (isExplode) ? "." : ",";
+
+ }else if(style == "form"){
+ return (isExplode) ? "&" + name + "=" : ",";
+
+ }else if(style == "simple"){
+ return ",";
+ }else if(style == "spaceDelimited"){
+ return (isExplode) ? "&" + name + "=" : " ";
+
+ }else if(style == "pipeDelimited"){
+ return (isExplode) ? "&" + name + "=" : "|";
+
+ }else if(style == "deepObject"){
+ return (isExplode) ? "&" : "none";
+
+ }else
+ return "none";
+}
+
{{#operations}}
{{#operation}}
void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {
QString fullPath = QString(_serverConfigs["{{nickname}}"][_serverIndices.value("{{nickname}}")].URL()+"{{{path}}}");
- {{#pathParams}}
- QString {{paramName}}PathParam("{");
- {{paramName}}PathParam.append("{{baseName}}").append("}");
- fullPath.replace({{paramName}}PathParam, QUrl::toPercentEncoding(::{{cppNamespace}}::toStringValue({{paramName}})));
- {{/pathParams}}{{#authMethods}}{{#isApiKey}}{{#isKeyInHeader}}
+ {{#authMethods}}{{#isApiKey}}{{#isKeyInHeader}}
if(_apiKeys.contains("{{name}}")){
addHeaders("{{name}}",_apiKeys.find("{{name}}").value());
}
@@ -168,18 +226,148 @@ void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName
b64.append(_username.toUtf8() + ":" + _password.toUtf8());
addHeaders("Authorization","Basic " + b64.toBase64());
}{{/isBasicBasic}}{{/authMethods}}
-{{#queryParams}}{{^collectionFormat}}
+ {{#pathParams}}
+ QString {{paramName}}PathParam("{");
+ {{paramName}}PathParam.append("{{baseName}}").append("}");
+ QString pathPrefix, pathSuffix, pathDelimiter;
+ QString pathStyle = "{{style}}";
+ if(pathStyle == "")
+ pathStyle = "simple";
+ pathPrefix = getParamStylePrefix(pathStyle);
+ pathSuffix = getParamStyleSuffix(pathStyle);
+ pathDelimiter = getParamStyleDelimiter(pathStyle, "{{baseName}}", {{isExplode}});
+ {{^collectionFormat}}
+ {{^isPrimitiveType}}
+ QString paramString = (pathStyle == "matrix" && {{isExplode}}) ? pathPrefix : pathPrefix+"{{baseName}}"+pathSuffix;
+ QJsonObject parameter = {{paramName}}.asJsonObject();
+ qint32 count = 0;
+ foreach(const QString& key, parameter.keys()) {
+ if (count > 0) {
+ pathDelimiter = (pathStyle == "matrix" && {{isExplode}}) ? ";" : getParamStyleDelimiter(pathStyle, key, {{isExplode}});
+ paramString.append(pathDelimiter);
+ }
+ QString assignOperator = ({{isExplode}}) ? "=" : ",";
+ switch(parameter.value(key).type()) {
+ case QJsonValue::String:
+ {
+ paramString.append(key+assignOperator+parameter.value(key).toString());
+ break;
+ }
+ case QJsonValue::Double:
+ {
+ paramString.append(key+assignOperator+QString::number(parameter.value(key).toDouble()));
+ break;
+ }
+ case QJsonValue::Bool:
+ {
+ paramString.append(key+assignOperator+QVariant(parameter.value(key).toBool()).toString());
+ break;
+ }
+ case QJsonValue::Array:
+ {
+ paramString.append(key+assignOperator+QVariant(parameter.value(key).toArray()).toString());
+ break;
+ }
+ case QJsonValue::Object:
+ {
+ paramString.append(key+assignOperator+QVariant(parameter.value(key).toObject()).toString());
+ break;
+ }
+ case QJsonValue::Null:
+ case QJsonValue::Undefined:
+ break;
+ }
+ count++;
+ }
+ fullPath.replace({{paramName}}PathParam, QUrl::toPercentEncoding(paramString));
+ {{/isPrimitiveType}}
+ {{#isPrimitiveType}}
+ QString paramString = (pathStyle == "matrix") ? pathPrefix+"{{baseName}}"+pathSuffix : pathPrefix;
+ fullPath.replace({{paramName}}PathParam, paramString+QUrl::toPercentEncoding(::{{cppNamespace}}::toStringValue({{paramName}})));
+{{/isPrimitiveType}}{{/collectionFormat}}{{#collectionFormat}}
+ if ({{{paramName}}}.size() > 0) {
+ QString paramString = (pathStyle == "matrix") ? pathPrefix+"{{baseName}}"+pathSuffix : pathPrefix;
+ qint32 count = 0;
+ foreach ({{{baseType}}} t, {{paramName}}) {
+ if (count > 0) {
+ fullPath.append(pathDelimiter);
+ }
+ fullPath.append(QUrl::toPercentEncoding(::{{cppNamespace}}::toStringValue(t)));
+ count++;
+ }
+ fullPath.replace({{paramName}}PathParam, paramString);
+ }
+{{/collectionFormat}}{{/pathParams}}
+ {{#hasQueryParams}}
+ QString queryPrefix, querySuffix, queryDelimiter, queryStyle;
+ {{/hasQueryParams}}
+{{#queryParams}}
+ queryStyle = "{{style}}";
+ if(queryStyle == "")
+ queryStyle = "form";
+ queryPrefix = getParamStylePrefix(queryStyle);
+ querySuffix = getParamStyleSuffix(queryStyle);
+ queryDelimiter = getParamStyleDelimiter(queryStyle, "{{baseName}}", {{isExplode}});
+{{^collectionFormat}}
if (fullPath.indexOf("?") > 0)
- fullPath.append("&");
+ fullPath.append(queryPrefix);
else
fullPath.append("?");
- fullPath.append(QUrl::toPercentEncoding("{{baseName}}")).append("=").append(QUrl::toPercentEncoding(::{{cppNamespace}}::toStringValue({{paramName}})));
-{{/collectionFormat}}{{#collectionFormat}}
+ {{^isPrimitiveType}}
+ QString paramString = (queryStyle == "form" && {{isExplode}}) ? "" : (queryStyle == "form" && !({{isExplode}})) ? "{{baseName}}"+querySuffix : "";
+ QJsonObject parameter = {{paramName}}.asJsonObject();
+ qint32 count = 0;
+ foreach(const QString& key, parameter.keys()) {
+ if (count > 0) {
+ queryDelimiter = ((queryStyle == "form" || queryStyle == "deepObject") && {{isExplode}}) ? "&" : getParamStyleDelimiter(queryStyle, key, {{isExplode}});
+ paramString.append(queryDelimiter);
+ }
+ QString assignOperator;
+ if (queryStyle == "form")
+ assignOperator = ({{isExplode}}) ? "=" : ",";
+ else if (queryStyle == "deepObject")
+ assignOperator = ({{isExplode}}) ? "=" : "none";
+ switch(parameter.value(key).type()) {
+ case QJsonValue::String:
+ {
+ paramString.append(((queryStyle == "form") ? key : QString("{{baseName}}").append("[").append(key).append("]"))+assignOperator+parameter.value(key).toString());
+ break;
+ }
+ case QJsonValue::Double:
+ {
+ paramString.append(((queryStyle == "form") ? key : QString("{{baseName}}").append("[").append(key).append("]"))+assignOperator+QString::number(parameter.value(key).toDouble()));
+ break;
+ }
+ case QJsonValue::Bool:
+ {
+ paramString.append(((queryStyle == "form") ? key : QString("{{baseName}}").append("[").append(key).append("]"))+assignOperator+QVariant(parameter.value(key).toBool()).toString());
+ break;
+ }
+ case QJsonValue::Array:
+ {
+ paramString.append(((queryStyle == "form") ? key : QString("{{baseName}}").append("[").append(key).append("]"))+assignOperator+QVariant(parameter.value(key).toArray()).toString());
+ break;
+ }
+ case QJsonValue::Object:
+ {
+ paramString.append(((queryStyle == "form") ? key : QString("{{baseName}}").append("[").append(key).append("]"))+assignOperator+QVariant(parameter.value(key).toObject()).toString());
+ break;
+ }
+ case QJsonValue::Null:
+ case QJsonValue::Undefined:
+ break;
+ }
+ count++;
+ }
+ fullPath.append(paramString);
+ {{/isPrimitiveType}}{{#isPrimitiveType}}
+ fullPath.append(QUrl::toPercentEncoding("{{baseName}}")).append(querySuffix).append(QUrl::toPercentEncoding(::{{cppNamespace}}::toStringValue({{paramName}})));
+{{/isPrimitiveType}}{{/collectionFormat}}{{#collectionFormat}}
if ({{{paramName}}}.size() > 0) {
if (QString("{{collectionFormat}}").indexOf("multi") == 0) {
foreach ({{{baseType}}} t, {{paramName}}) {
if (fullPath.indexOf("?") > 0)
- fullPath.append("&");
+ fullPath.append(queryPrefix);
else
fullPath.append("?");
fullPath.append("{{{baseName}}}=").append(::{{cppNamespace}}::toStringValue(t));
@@ -188,28 +376,67 @@ void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
- fullPath.append("?");
- fullPath.append("{{baseName}}=");
+ fullPath.append("?").append(queryPrefix).append("{{baseName}}").append(querySuffix);
qint32 count = 0;
foreach ({{{baseType}}} t, {{paramName}}) {
if (count > 0) {
- fullPath.append(" ");
+ fullPath.append(({{isExplode}})? queryDelimiter : QUrl::toPercentEncoding(queryDelimiter));
}
fullPath.append(::{{cppNamespace}}::toStringValue(t));
+ count++;
}
} else if (QString("{{collectionFormat}}").indexOf("tsv") == 0) {
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
- fullPath.append("?");
- fullPath.append("{{baseName}}=");
+ fullPath.append("?").append(queryPrefix).append("{{baseName}}").append(querySuffix);
qint32 count = 0;
foreach ({{{baseType}}} t, {{paramName}}) {
if (count > 0) {
fullPath.append("\t");
}
fullPath.append(::{{cppNamespace}}::toStringValue(t));
+ count++;
}
+ } else if (QString("{{collectionFormat}}").indexOf("csv") == 0) {
+ if (fullPath.indexOf("?") > 0)
+ fullPath.append("&");
+ else
+ fullPath.append("?").append(queryPrefix).append("{{baseName}}").append(querySuffix);
+ qint32 count = 0;
+ foreach ({{{baseType}}} t, {{paramName}}) {
+ if (count > 0) {
+ fullPath.append(queryDelimiter);
+ }
+ fullPath.append(::{{cppNamespace}}::toStringValue(t));
+ count++;
+ }
+ } else if (QString("{{collectionFormat}}").indexOf("pipes") == 0) {
+ if (fullPath.indexOf("?") > 0)
+ fullPath.append("&");
+ else
+ fullPath.append("?").append(queryPrefix).append("{{baseName}}").append(querySuffix);
+ qint32 count = 0;
+ foreach ({{{baseType}}} t, {{paramName}}) {
+ if (count > 0) {
+ fullPath.append(queryDelimiter);
+ }
+ fullPath.append(::{{cppNamespace}}::toStringValue(t));
+ count++;
+ }
+ } else if (QString("{{collectionFormat}}").indexOf("deepObject") == 0) {
+ if (fullPath.indexOf("?") > 0)
+ fullPath.append("&");
+ else
+ fullPath.append("?").append(queryPrefix).append("{{baseName}}").append(querySuffix);
+ qint32 count = 0;
+ foreach ({{{baseType}}} t, {{paramName}}) {
+ if (count > 0) {
+ fullPath.append(queryDelimiter);
+ }
+ fullPath.append(::{{cppNamespace}}::toStringValue(t));
+ count++;
+ }
}
}
{{/collectionFormat}}{{/queryParams}}
@@ -219,7 +446,18 @@ void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName
worker->setResponseCompressionEnabled(isResponseCompressionEnabled);
worker->setRequestCompressionEnabled(isRequestCompressionEnabled);{{/contentCompression}}
{{prefix}}HttpRequestInput input(fullPath, "{{httpMethod}}");
-{{#formParams}}{{^isFile}}
+
+{{#formParams}}
+ {{#first}}
+ QString formPrefix,formSuffix, formDelimiter;
+ QString formStyle = "{{style}}";
+ if(formStyle == "")
+ formStyle = "form";
+ formPrefix = getParamStylePrefix(formStyle);
+ formSuffix = getParamStyleSuffix(formStyle);
+ formDelimiter = getParamStyleDelimiter(formStyle, "{{baseName}}", {{isExplode}});
+ {{/first}}
+{{^isFile}}
input.add_var("{{baseName}}", ::{{cppNamespace}}::toStringValue({{paramName}}));{{/isFile}}{{#isFile}}
input.add_file("{{baseName}}", {{paramName}}.local_filename, {{paramName}}.request_filename, {{paramName}}.mime_type);{{/isFile}}{{/formParams}}{{#bodyParams}}{{#isContainer}}{{#isArray}}
QJsonDocument doc(::{{cppNamespace}}::toJsonValue({{paramName}}).toArray());{{/isArray}}{{#isMap}}
@@ -227,16 +465,135 @@ void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName
QByteArray bytes = doc.toJson();
input.request_body.append(bytes);
{{/isContainer}}{{^isContainer}}{{#isString}}
- QString output({{paramName}});{{/isString}}{{#isByteArray}}QString output({{paramName}});{{/isByteArray}}{{^isString}}{{^isByteArray}}{{^isFile}}
- QString output = {{paramName}}.asJson();{{/isFile}}{{/isByteArray}}{{/isString}}{{#isFile}}{{#hasConsumes}}input.headers.insert("Content-Type", {{#consumes}}{{^-first}}, {{/-first}}"{{mediaType}}"{{/consumes}});{{/hasConsumes}}
+ QByteArray output = {{paramName}}.toUtf8();{{/isString}}{{#isByteArray}}QByteArray output({{paramName}});{{/isByteArray}}{{^isString}}{{^isByteArray}}{{^isFile}}
+ QByteArray output = {{paramName}}.asJson().toUtf8();{{/isFile}}{{/isByteArray}}{{/isString}}{{#isFile}}{{#hasConsumes}}input.headers.insert("Content-Type", {{#consumes}}{{^-first}}, {{/-first}}"{{mediaType}}"{{/consumes}});{{/hasConsumes}}
QByteArray output = {{paramName}}.asByteArray();{{/isFile}}
- input.request_body.append(output.toUtf8());
+ input.request_body.append(output);
{{/isContainer}}{{/bodyParams}}{{#headerParams}}
+{{^collectionFormat}}{{^isPrimitiveType}}
+ QString headerString;
+ QJsonObject parameter = {{paramName}}.asJsonObject();
+ qint32 count = 0;
+ foreach(const QString& key, parameter.keys()) {
+ if (count > 0) {
+ headerString.append(",");
+ }
+ QString assignOperator = ({{isExplode}}) ? "=" : ",";
+ switch(parameter.value(key).type()) {
+ case QJsonValue::String:
+ {
+ headerString.append(key+assignOperator+parameter.value(key).toString());
+ break;
+ }
+ case QJsonValue::Double:
+ {
+ headerString.append(key+assignOperator+QString::number(parameter.value(key).toDouble()));
+ break;
+ }
+ case QJsonValue::Bool:
+ {
+ headerString.append(key+assignOperator+QVariant(parameter.value(key).toBool()).toString());
+ break;
+ }
+ case QJsonValue::Array:
+ {
+ headerString.append(key+assignOperator+QVariant(parameter.value(key).toArray()).toString());
+ break;
+ }
+ case QJsonValue::Object:
+ {
+ headerString.append(key+assignOperator+QVariant(parameter.value(key).toObject()).toString());
+ break;
+ }
+ case QJsonValue::Null:
+ case QJsonValue::Undefined:
+ break;
+ }
+ count++;
+ }
+ input.headers.insert("{{baseName}}", headerString);
+{{/isPrimitiveType}}{{#isPrimitiveType}}
if (!::{{cppNamespace}}::toStringValue({{paramName}}).isEmpty()) {
input.headers.insert("{{baseName}}", ::{{cppNamespace}}::toStringValue({{paramName}}));
}
+{{/isPrimitiveType}}{{/collectionFormat}}{{#collectionFormat}}
+ QString headerString;
+ if ({{{paramName}}}.size() > 0) {
+ qint32 count = 0;
+ foreach ({{{baseType}}} t, {{paramName}}) {
+ if (count > 0) {
+ headerString.append(",");
+ }
+ headerString.append(::{{cppNamespace}}::toStringValue(t));
+ count++;
+ }
+ input.headers.insert("{{baseName}}", headerString);
+ }
+{{/collectionFormat}}
{{/headerParams}}
-
+{{#cookieParams}}
+if(QString("{{style}}").indexOf("form") == 0){
+{{^collectionFormat}}{{^isPrimitiveType}}{{^isExplode}}
+ QString cookieString = "{{baseName}}=";
+ QJsonObject parameter = {{paramName}}.asJsonObject();
+ qint32 count = 0;
+ foreach(const QString& key, parameter.keys()) {
+ if (count > 0) {
+ cookieString.append(",");
+ }
+ switch(parameter.value(key).type()) {
+ case QJsonValue::String:
+ {
+ cookieString.append(key+","+parameter.value(key).toString());
+ break;
+ }
+ case QJsonValue::Double:
+ {
+ cookieString.append(key+","+QString::number(parameter.value(key).toDouble()));
+ break;
+ }
+ case QJsonValue::Bool:
+ {
+ cookieString.append(key+","+QVariant(parameter.value(key).toBool()).toString());
+ break;
+ }
+ case QJsonValue::Array:
+ {
+ cookieString.append(key+","+QVariant(parameter.value(key).toArray()).toString());
+ break;
+ }
+ case QJsonValue::Object:
+ {
+ cookieString.append(key+","+QVariant(parameter.value(key).toObject()).toString());
+ break;
+ }
+ case QJsonValue::Null:
+ case QJsonValue::Undefined:
+ break;
+ }
+ count++;
+ }
+ input.headers.insert("Cookie", cookieString);
+{{/isExplode}}{{/isPrimitiveType}}{{#isPrimitiveType}}
+ if (!::{{cppNamespace}}::toStringValue({{paramName}}).isEmpty()) {
+ input.headers.insert("Cookie", "{{baseName}}="+::{{cppNamespace}}::toStringValue({{paramName}}));
+ }
+{{/isPrimitiveType}}{{/collectionFormat}}{{#collectionFormat}}{{^isExplode}}
+ QString cookieString = "{{baseName}}=";
+ if ({{{paramName}}}.size() > 0) {
+ qint32 count = 0;
+ foreach ({{{baseType}}} t, {{paramName}}) {
+ if (count > 0) {
+ cookieString.append(",");
+ }
+ cookieString.append(::{{cppNamespace}}::toStringValue(t));
+ count++;
+ }
+ input.headers.insert("Cookie", cookieString);
+ }
+{{/isExplode}}{{/collectionFormat}}
+}
+{{/cookieParams}}
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
connect(worker, &{{prefix}}HttpRequestWorker::on_execution_finished, this, &{{classname}}::{{nickname}}Callback);
diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache
index f802c2015da8..424c12d58a6f 100644
--- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache
+++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache
@@ -43,6 +43,10 @@ public:
void enableRequestCompression();
void enableResponseCompression();
void abortRequests();
+ QString getParamStylePrefix(QString style);
+ QString getParamStyleSuffix(QString style);
+ QString getParamStyleDelimiter(QString style, QString name, bool isExplode);
+
{{#operations}}{{#operation}}
void {{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/operation}}{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/cpp-restbed-server/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/model-source.mustache
index 06f161f2f075..9d56632b7fb9 100644
--- a/modules/openapi-generator/src/main/resources/cpp-restbed-server/model-source.mustache
+++ b/modules/openapi-generator/src/main/resources/cpp-restbed-server/model-source.mustache
@@ -5,6 +5,7 @@
#include
#include
+#include
{{#hasEnums}}
#include
{{/hasEnums}}
diff --git a/modules/openapi-generator/src/main/resources/dart2/api_client.mustache b/modules/openapi-generator/src/main/resources/dart2/api_client.mustache
index e6e6b07771ca..44af2418ca9d 100644
--- a/modules/openapi-generator/src/main/resources/dart2/api_client.mustache
+++ b/modules/openapi-generator/src/main/resources/dart2/api_client.mustache
@@ -49,6 +49,13 @@ class ApiClient {
_defaultHeaderMap[key] = value;
}
+ Map get defaultHeaderMap => _defaultHeaderMap;
+
+ /// returns an unmodifiable view of the authentications, since none should be added
+ /// nor deleted
+ Map get authentications =>
+ Map.unmodifiable(_authentications);
+
dynamic deserialize(String json, String targetType, {bool growable}) {
// Remove all spaces. Necessary for reg expressions as well.
targetType = targetType.replaceAll(' ', '');
diff --git a/modules/openapi-generator/src/main/resources/python-aiohttp/__init__main.mustache b/modules/openapi-generator/src/main/resources/python-aiohttp/__init__main.mustache
index ba3fa3a65843..e185ac470d96 100644
--- a/modules/openapi-generator/src/main/resources/python-aiohttp/__init__main.mustache
+++ b/modules/openapi-generator/src/main/resources/python-aiohttp/__init__main.mustache
@@ -1,6 +1,8 @@
import os
import connexion
-
+{{#featureCORS}}
+import aiohttp_cors
+{{/featureCORS}}
def main():
options = {
@@ -12,4 +14,20 @@ def main():
arguments={'title': '{{appName}}'},
pythonic_params=True,
pass_context_arg_name='request')
+
+{{#featureCORS}}
+ # Enable CORS for all origins.
+ cors = aiohttp_cors.setup(app.app, defaults={
+ "*": aiohttp_cors.ResourceOptions(
+ allow_credentials=True,
+ expose_headers="*",
+ allow_headers="*",
+ )
+ })
+
+ # Register all routers for CORS.
+ for route in list(app.app.router.routes()):
+ cors.add(route)
+
+{{/featureCORS}}
app.run(port={{serverPort}})
diff --git a/modules/openapi-generator/src/main/resources/python-aiohttp/requirements.mustache b/modules/openapi-generator/src/main/resources/python-aiohttp/requirements.mustache
index e0dd796ca9fb..b828c50f4a24 100644
--- a/modules/openapi-generator/src/main/resources/python-aiohttp/requirements.mustache
+++ b/modules/openapi-generator/src/main/resources/python-aiohttp/requirements.mustache
@@ -7,3 +7,6 @@ connexion[aiohttp,swagger-ui] <= 2.3.0; python_version=="3.5" or python_version=
werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4"
swagger-ui-bundle == 0.0.6
aiohttp_jinja2 == 1.2.0
+{{#featureCORS}}
+aiohttp_cors >= 0.7.0
+{{/featureCORS}}
diff --git a/modules/openapi-generator/src/main/resources/python-blueplanet/app/requirements.mustache b/modules/openapi-generator/src/main/resources/python-blueplanet/app/requirements.mustache
index d08b80acc5b3..275787f38cc3 100644
--- a/modules/openapi-generator/src/main/resources/python-blueplanet/app/requirements.mustache
+++ b/modules/openapi-generator/src/main/resources/python-blueplanet/app/requirements.mustache
@@ -7,3 +7,7 @@ setuptools >= 21.0.0
bp2hookutil==3.3.0
plansdk
twigjack
+{{#featureCORS}}
+# should support both Python 2 and Python 3
+flask-cors >= 3.0.10
+{{/featureCORS}}
diff --git a/modules/openapi-generator/src/main/resources/python-blueplanet/app/{{packageName}}/__main__.mustache b/modules/openapi-generator/src/main/resources/python-blueplanet/app/{{packageName}}/__main__.mustache
index 10756347223c..ab6835dac859 100644
--- a/modules/openapi-generator/src/main/resources/python-blueplanet/app/{{packageName}}/__main__.mustache
+++ b/modules/openapi-generator/src/main/resources/python-blueplanet/app/{{packageName}}/__main__.mustache
@@ -6,6 +6,9 @@
{{/supportPython2}}
import connexion
+{{#featureCORS}}
+from flask_cors import CORS
+{{/featureCORS}}
from {{packageName}} import encoder
@@ -14,6 +17,12 @@ def main():
app = connexion.App(__name__, specification_dir='./swagger/')
app.app.json_encoder = encoder.JSONEncoder
app.add_api('swagger.yaml', arguments={'title': '{{appName}}'})
+
+{{#featureCORS}}
+ # add CORS support
+ CORS(app.app)
+
+{{/featureCORS}}
app.run(port={{serverPort}})
diff --git a/modules/openapi-generator/src/main/resources/python-flask/__main__.mustache b/modules/openapi-generator/src/main/resources/python-flask/__main__.mustache
index 37b7a8bab471..b6018a3af051 100644
--- a/modules/openapi-generator/src/main/resources/python-flask/__main__.mustache
+++ b/modules/openapi-generator/src/main/resources/python-flask/__main__.mustache
@@ -6,6 +6,9 @@
{{/supportPython2}}
import connexion
+{{#featureCORS}}
+from flask_cors import CORS
+{{/featureCORS}}
from {{packageName}} import encoder
@@ -16,6 +19,12 @@ def main():
app.add_api('openapi.yaml',
arguments={'title': '{{appName}}'},
pythonic_params=True)
+
+{{#featureCORS}}
+ # add CORS support
+ CORS(app.app)
+
+{{/featureCORS}}
app.run(port={{serverPort}})
diff --git a/modules/openapi-generator/src/main/resources/python-flask/requirements.mustache b/modules/openapi-generator/src/main/resources/python-flask/requirements.mustache
index 6e3f7d524c2c..6e2cf517819f 100644
--- a/modules/openapi-generator/src/main/resources/python-flask/requirements.mustache
+++ b/modules/openapi-generator/src/main/resources/python-flask/requirements.mustache
@@ -10,6 +10,10 @@ connexion[swagger-ui] == 2.4.0; python_version<="2.7"
werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4"
swagger-ui-bundle >= 0.0.2
python_dateutil >= 2.6.0
+{{#featureCORS}}
+# should support both Python 2 and Python 3
+flask-cors >= 3.0.10
+{{/featureCORS}}
{{#supportPython2}}
typing >= 3.5.2.2
# For specs with timestamps, pyyaml 5.3 broke connexion's spec parsing in python 2.
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/model.mustache b/modules/openapi-generator/src/main/resources/python-legacy/model.mustache
index 857a3e48fb4d..5b4048915eb8 100644
--- a/modules/openapi-generator/src/main/resources/python-legacy/model.mustache
+++ b/modules/openapi-generator/src/main/resources/python-legacy/model.mustache
@@ -61,7 +61,7 @@ class {{classname}}(object):
def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}, local_vars_configuration=None): # noqa: E501
"""{{classname}} - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
- local_vars_configuration = Configuration()
+ local_vars_configuration = Configuration.get_default_copy()
self.local_vars_configuration = local_vars_configuration
{{#vars}}{{#-first}}
{{/-first}}
diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache
index 9b9a04fefd91..8d6395a4c2e7 100644
--- a/modules/openapi-generator/src/main/resources/python/api_client.mustache
+++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache
@@ -61,7 +61,7 @@ class ApiClient(object):
def __init__(self, configuration=None, header_name=None, header_value=None,
cookie=None, pool_threads=1):
if configuration is None:
- configuration = Configuration()
+ configuration = Configuration.get_default_copy()
self.configuration = configuration
self.pool_threads = pool_threads
diff --git a/modules/openapi-generator/src/main/resources/python/model.mustache b/modules/openapi-generator/src/main/resources/python/model.mustache
index 34fd9e5cde7b..680b60644c0d 100644
--- a/modules/openapi-generator/src/main/resources/python/model.mustache
+++ b/modules/openapi-generator/src/main/resources/python/model.mustache
@@ -3,8 +3,6 @@
import re # noqa: F401
import sys # noqa: F401
-import nulltype # noqa: F401
-
from {{packageName}}.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/method_init_composed.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/method_init_composed.mustache
index 8b3650b33a2c..9b298379710c 100644
--- a/modules/openapi-generator/src/main/resources/python/model_templates/method_init_composed.mustache
+++ b/modules/openapi-generator/src/main/resources/python/model_templates/method_init_composed.mustache
@@ -24,11 +24,6 @@
'{{name}}': {{name}},
{{/requiredVars}}
}
- # remove args whose value is Null because they are unset
- required_arg_names = list(required_args.keys())
- for required_arg_name in required_arg_names:
- if required_args[required_arg_name] is nulltype.Null:
- del required_args[required_arg_name]
model_args = {}
model_args.update(required_args)
model_args.update(kwargs)
diff --git a/modules/openapi-generator/src/main/resources/python/requirements.mustache b/modules/openapi-generator/src/main/resources/python/requirements.mustache
index 73a84334c8b6..96947f60408f 100644
--- a/modules/openapi-generator/src/main/resources/python/requirements.mustache
+++ b/modules/openapi-generator/src/main/resources/python/requirements.mustache
@@ -1,4 +1,3 @@
-nulltype
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.25.3
diff --git a/modules/openapi-generator/src/main/resources/python/setup.mustache b/modules/openapi-generator/src/main/resources/python/setup.mustache
index 707ff5bb506b..d5154f3fa6f1 100644
--- a/modules/openapi-generator/src/main/resources/python/setup.mustache
+++ b/modules/openapi-generator/src/main/resources/python/setup.mustache
@@ -17,7 +17,6 @@ VERSION = "{{packageVersion}}"
REQUIRES = [
"urllib3 >= 1.25.3",
"python-dateutil",
- "nulltype",
{{#asyncio}}
"aiohttp >= 3.0.0",
{{/asyncio}}
diff --git a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache
index 4c733fbafe4a..a822a9001939 100644
--- a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache
+++ b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache
@@ -7,6 +7,18 @@ description = "{{{appDescription}}}"
{{/appDescription}}
license = "Unlicense"
edition = "2018"
+{{#publishRustRegistry}}
+publish = ["{{publishRustRegistry}}"]
+{{/publishRustRegistry}}
+{{#repositoryUrl}}
+repository = "{{repositoryUrl}}"
+{{/repositoryUrl}}
+{{#documentationUrl}}
+documentation = "{{documentationUrl}}"
+{{/documentationUrl}}
+{{#homePageUrl}}
+homepage = "{{homePageUrl}}
+{{/homePageUrl}}
[features]
default = ["client", "server"]
diff --git a/modules/openapi-generator/src/main/resources/rust-server/README.mustache b/modules/openapi-generator/src/main/resources/rust-server/README.mustache
index 7cb75705f5ff..3a5a0299e9d7 100644
--- a/modules/openapi-generator/src/main/resources/rust-server/README.mustache
+++ b/modules/openapi-generator/src/main/resources/rust-server/README.mustache
@@ -129,13 +129,20 @@ Example
{{! TODO: Add API Key example }}
```
{{/isApiKey}}
-{{#isBasic}}- **Type**: HTTP basic authentication
+{{#isBasicBasic}}- **Type**: HTTP basic authentication
Example
```
{{! TODO: Add HTTP basic authentication }}
```
-{{/isBasic}}
+{{/isBasicBasic}}
+{{#isBasicBearer}}- **Type**: Bearer token authentication
+
+Example
+```
+ {{! TODO: Add Bearer token authentication }}
+```
+{{/isBasicBearer}}
{{#isOAuth}}- **Type**: OAuth
- **Flow**: {{{flow}}}
- **Authorization URL**: {{{authorizationUrl}}}
diff --git a/modules/openapi-generator/src/main/resources/rust-server/context.mustache b/modules/openapi-generator/src/main/resources/rust-server/context.mustache
index 34635451f5db..f3e1c5e130ac 100644
--- a/modules/openapi-generator/src/main/resources/rust-server/context.mustache
+++ b/modules/openapi-generator/src/main/resources/rust-server/context.mustache
@@ -106,6 +106,7 @@ impl Service> for AddContext Service> for AddContext(&headers) {
+ let auth_data = AuthData::Bearer(bearer);
+ let context = context.push(Some(auth_data));
+ let context = context.push(None::);
+
+ return self.inner.call((request, context))
+ }
+ }
+ {{/isBasicBearer}}
{{/isBasic}}
{{#isOAuth}}
{
diff --git a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache
index 1be0c7c2aada..a2caeaa84af3 100644
--- a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache
+++ b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache
@@ -5,6 +5,7 @@ use futures::Stream;
use std::error::Error;
use std::task::{Poll, Context};
use swagger::{ApiError, ContextWrapper};
+use serde::{Serialize, Deserialize};
type ServiceError = Box;
diff --git a/modules/openapi-generator/src/main/resources/rust-server/response.mustache b/modules/openapi-generator/src/main/resources/rust-server/response.mustache
index 39ff27821652..754667acd719 100644
--- a/modules/openapi-generator/src/main/resources/rust-server/response.mustache
+++ b/modules/openapi-generator/src/main/resources/rust-server/response.mustache
@@ -1,4 +1,4 @@
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Serialize, Deserialize)]
{{#vendorExtensions.x-must-use-response}}
#[must_use]
{{/vendorExtensions.x-must-use-response}}
diff --git a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache
index 54a1518f85bd..977f0b6edbcf 100644
--- a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache
+++ b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache
@@ -283,7 +283,7 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration:
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text(){{#supportAsync}}.await{{/supportAsync}}?;
- if local_var_status.is_success() {
+ if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
{{^supportMultipleResponses}}
{{^returnType}}
Ok(())
diff --git a/modules/openapi-generator/src/main/resources/rust/reqwest/api_mod.mustache b/modules/openapi-generator/src/main/resources/rust/reqwest/api_mod.mustache
index 5bf951361d97..e4daf80c8f6f 100644
--- a/modules/openapi-generator/src/main/resources/rust/reqwest/api_mod.mustache
+++ b/modules/openapi-generator/src/main/resources/rust/reqwest/api_mod.mustache
@@ -1,5 +1,3 @@
-use reqwest;
-use serde_json;
use std::error;
use std::fmt;
diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache
index 95733f9d546b..294dc7418ea6 100644
--- a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache
+++ b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache
@@ -24,9 +24,6 @@ private var urlSessionStore = SynchronizedDictionary()
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class URLSessionRequestBuilder: RequestBuilder {
- // swiftlint:disable:next weak_delegate
- fileprivate let sessionDelegate = SessionDelegate()
-
/**
May be assigned if you want to control the authentication challenges.
*/
@@ -52,6 +49,7 @@ private var urlSessionStore = SynchronizedDictionary()
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func createURLSession() -> URLSession {
let configuration = URLSessionConfiguration.default
configuration.httpAdditionalHeaders = buildHeaders()
+ let sessionDelegate = SessionDelegate()
sessionDelegate.credential = credential
sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge
return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil)
@@ -126,6 +124,7 @@ private var urlSessionStore = SynchronizedDictionary()
}
let cleanupRequest = {
+ urlSessionStore[urlSessionId]?.finishTasksAndInvalidate()
urlSessionStore[urlSessionId] = nil
}
@@ -144,12 +143,14 @@ private var urlSessionStore = SynchronizedDictionary()
} else {
apiResponseQueue.async {
self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion)
+ cleanupRequest()
}
}
}
} else {
apiResponseQueue.async {
self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion)
+ cleanupRequest()
}
}
}
diff --git a/modules/openapi-generator/src/test/resources/3_0/rust-server/ping-bearer-auth.yaml b/modules/openapi-generator/src/test/resources/3_0/rust-server/ping-bearer-auth.yaml
new file mode 100644
index 000000000000..a503051829f1
--- /dev/null
+++ b/modules/openapi-generator/src/test/resources/3_0/rust-server/ping-bearer-auth.yaml
@@ -0,0 +1,21 @@
+openapi: 3.0.1
+info:
+ title: ping test
+ version: '1.0'
+servers:
+ - url: 'http://localhost:8080/'
+paths:
+ /ping:
+ get:
+ operationId: pingGet
+ responses:
+ '201':
+ description: OK
+components:
+ securitySchemes:
+ bearerAuth:
+ scheme: bearer
+ bearerFormat: token
+ type: http
+security:
+ - bearerAuth: []
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index bb2c66cc2ea5..c37fce53aa04 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1338,6 +1338,7 @@
samples/client/petstore/java/resttemplate-withXmlsamples/client/petstore/java/webclientsamples/client/petstore/java/vertx
+ samples/client/petstore/java/jersey2-java8-localdatetimesamples/client/petstore/java/resteasysamples/client/petstore/java/google-api-clientsamples/client/petstore/java/rest-assured
diff --git a/samples/client/petstore/R/docs/PetApi.md b/samples/client/petstore/R/docs/PetApi.md
index 971e94cf453a..b6739b621972 100644
--- a/samples/client/petstore/R/docs/PetApi.md
+++ b/samples/client/petstore/R/docs/PetApi.md
@@ -23,7 +23,7 @@ Add a new pet to the store
```R
library(petstore)
-var.body <- Pet$new(123, Category$new(123, "name_example"), "name_example", list("photoUrls_example"), list(Tag$new(123, "name_example")), "status_example") # Pet | Pet object that needs to be added to the store
+var.body <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
#Add a new pet to the store
api.instance <- PetApi$new()
@@ -111,7 +111,7 @@ Multiple status values can be provided with comma separated strings
```R
library(petstore)
-var.status <- list("status_example") # array[character] | Status values that need to be considered for filter
+var.status <- list("available") # array[character] | Status values that need to be considered for filter
#Finds Pets by status
api.instance <- PetApi$new()
@@ -248,7 +248,7 @@ Update an existing pet
```R
library(petstore)
-var.body <- Pet$new(123, Category$new(123, "name_example"), "name_example", list("photoUrls_example"), list(Tag$new(123, "name_example")), "status_example") # Pet | Pet object that needs to be added to the store
+var.body <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
#Update an existing pet
api.instance <- PetApi$new()
diff --git a/samples/client/petstore/R/docs/StoreApi.md b/samples/client/petstore/R/docs/StoreApi.md
index 8ff91cfe8116..9ffccdc5fe3c 100644
--- a/samples/client/petstore/R/docs/StoreApi.md
+++ b/samples/client/petstore/R/docs/StoreApi.md
@@ -148,7 +148,7 @@ Place an order for a pet
```R
library(petstore)
-var.body <- Order$new(123, 123, 123, "shipDate_example", "status_example", "complete_example") # Order | order placed for purchasing the pet
+var.body <- Order$new(123, 123, 123, "shipDate_example", "placed", "complete_example") # Order | order placed for purchasing the pet
#Place an order for a pet
api.instance <- StoreApi$new()
diff --git a/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp
index 42c59efa8e92..d2341ed0e1b0 100644
--- a/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp
+++ b/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp
@@ -145,8 +145,71 @@ void PFXPetApi::abortRequests(){
emit abortRequestsSignal();
}
+QString PFXPetApi::getParamStylePrefix(QString style){
+
+ if(style == "matrix"){
+ return ";";
+ }else if(style == "label"){
+ return ".";
+ }else if(style == "form"){
+ return "&";
+ }else if(style == "simple"){
+ return "";
+ }else if(style == "spaceDelimited"){
+ return "&";
+ }else if(style == "pipeDelimited"){
+ return "&";
+ }else
+ return "none";
+}
+
+QString PFXPetApi::getParamStyleSuffix(QString style){
+
+ if(style == "matrix"){
+ return "=";
+ }else if(style == "label"){
+ return "";
+ }else if(style == "form"){
+ return "=";
+ }else if(style == "simple"){
+ return "";
+ }else if(style == "spaceDelimited"){
+ return "=";
+ }else if(style == "pipeDelimited"){
+ return "=";
+ }else
+ return "none";
+}
+
+QString PFXPetApi::getParamStyleDelimiter(QString style, QString name, bool isExplode){
+
+ if(style == "matrix"){
+ return (isExplode) ? ";" + name + "=" : ",";
+
+ }else if(style == "label"){
+ return (isExplode) ? "." : ",";
+
+ }else if(style == "form"){
+ return (isExplode) ? "&" + name + "=" : ",";
+
+ }else if(style == "simple"){
+ return ",";
+ }else if(style == "spaceDelimited"){
+ return (isExplode) ? "&" + name + "=" : " ";
+
+ }else if(style == "pipeDelimited"){
+ return (isExplode) ? "&" + name + "=" : "|";
+
+ }else if(style == "deepObject"){
+ return (isExplode) ? "&" : "none";
+
+ }else
+ return "none";
+}
+
void PFXPetApi::addPet(const PFXPet &body) {
QString fullPath = QString(_serverConfigs["addPet"][_serverIndices.value("addPet")].URL()+"/pet");
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
@@ -154,9 +217,9 @@ void PFXPetApi::addPet(const PFXPet &body) {
worker->setWorkingDirectory(_workingDirectory);
PFXHttpRequestInput input(fullPath, "POST");
- QString output = body.asJson();
- input.request_body.append(output.toUtf8());
+ QByteArray output = body.asJson().toUtf8();
+ input.request_body.append(output);
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::addPetCallback);
@@ -188,20 +251,30 @@ void PFXPetApi::addPetCallback(PFXHttpRequestWorker *worker) {
void PFXPetApi::deletePet(const qint64 &pet_id, const QString &api_key) {
QString fullPath = QString(_serverConfigs["deletePet"][_serverIndices.value("deletePet")].URL()+"/pet/{petId}");
+
QString pet_idPathParam("{");
pet_idPathParam.append("petId").append("}");
- fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id)));
-
+ QString pathPrefix, pathSuffix, pathDelimiter;
+ QString pathStyle = "";
+ if(pathStyle == "")
+ pathStyle = "simple";
+ pathPrefix = getParamStylePrefix(pathStyle);
+ pathSuffix = getParamStyleSuffix(pathStyle);
+ pathDelimiter = getParamStyleDelimiter(pathStyle, "petId", false);
+ QString paramString = (pathStyle == "matrix") ? pathPrefix+"petId"+pathSuffix : pathPrefix;
+ fullPath.replace(pet_idPathParam, paramString+QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id)));
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
worker->setTimeOut(_timeOut);
worker->setWorkingDirectory(_workingDirectory);
PFXHttpRequestInput input(fullPath, "DELETE");
+
+
if (!::test_namespace::toStringValue(api_key).isEmpty()) {
input.headers.insert("api_key", ::test_namespace::toStringValue(api_key));
}
-
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::deletePetCallback);
@@ -233,13 +306,21 @@ void PFXPetApi::deletePetCallback(PFXHttpRequestWorker *worker) {
void PFXPetApi::findPetsByStatus(const QList &status) {
QString fullPath = QString(_serverConfigs["findPetsByStatus"][_serverIndices.value("findPetsByStatus")].URL()+"/pet/findByStatus");
+
+ QString queryPrefix, querySuffix, queryDelimiter, queryStyle;
+ queryStyle = "form";
+ if(queryStyle == "")
+ queryStyle = "form";
+ queryPrefix = getParamStylePrefix(queryStyle);
+ querySuffix = getParamStyleSuffix(queryStyle);
+ queryDelimiter = getParamStyleDelimiter(queryStyle, "status", false);
if (status.size() > 0) {
if (QString("csv").indexOf("multi") == 0) {
foreach (QString t, status) {
if (fullPath.indexOf("?") > 0)
- fullPath.append("&");
+ fullPath.append(queryPrefix);
else
fullPath.append("?");
fullPath.append("status=").append(::test_namespace::toStringValue(t));
@@ -248,28 +329,67 @@ void PFXPetApi::findPetsByStatus(const QList &status) {
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
- fullPath.append("?");
- fullPath.append("status=");
+ fullPath.append("?").append(queryPrefix).append("status").append(querySuffix);
qint32 count = 0;
foreach (QString t, status) {
if (count > 0) {
- fullPath.append(" ");
+ fullPath.append((false)? queryDelimiter : QUrl::toPercentEncoding(queryDelimiter));
}
fullPath.append(::test_namespace::toStringValue(t));
+ count++;
}
} else if (QString("csv").indexOf("tsv") == 0) {
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
- fullPath.append("?");
- fullPath.append("status=");
+ fullPath.append("?").append(queryPrefix).append("status").append(querySuffix);
qint32 count = 0;
foreach (QString t, status) {
if (count > 0) {
fullPath.append("\t");
}
fullPath.append(::test_namespace::toStringValue(t));
+ count++;
}
+ } else if (QString("csv").indexOf("csv") == 0) {
+ if (fullPath.indexOf("?") > 0)
+ fullPath.append("&");
+ else
+ fullPath.append("?").append(queryPrefix).append("status").append(querySuffix);
+ qint32 count = 0;
+ foreach (QString t, status) {
+ if (count > 0) {
+ fullPath.append(queryDelimiter);
+ }
+ fullPath.append(::test_namespace::toStringValue(t));
+ count++;
+ }
+ } else if (QString("csv").indexOf("pipes") == 0) {
+ if (fullPath.indexOf("?") > 0)
+ fullPath.append("&");
+ else
+ fullPath.append("?").append(queryPrefix).append("status").append(querySuffix);
+ qint32 count = 0;
+ foreach (QString t, status) {
+ if (count > 0) {
+ fullPath.append(queryDelimiter);
+ }
+ fullPath.append(::test_namespace::toStringValue(t));
+ count++;
+ }
+ } else if (QString("csv").indexOf("deepObject") == 0) {
+ if (fullPath.indexOf("?") > 0)
+ fullPath.append("&");
+ else
+ fullPath.append("?").append(queryPrefix).append("status").append(querySuffix);
+ qint32 count = 0;
+ foreach (QString t, status) {
+ if (count > 0) {
+ fullPath.append(queryDelimiter);
+ }
+ fullPath.append(::test_namespace::toStringValue(t));
+ count++;
+ }
}
}
@@ -319,13 +439,21 @@ void PFXPetApi::findPetsByStatusCallback(PFXHttpRequestWorker *worker) {
void PFXPetApi::findPetsByTags(const QList &tags) {
QString fullPath = QString(_serverConfigs["findPetsByTags"][_serverIndices.value("findPetsByTags")].URL()+"/pet/findByTags");
+
+ QString queryPrefix, querySuffix, queryDelimiter, queryStyle;
+ queryStyle = "form";
+ if(queryStyle == "")
+ queryStyle = "form";
+ queryPrefix = getParamStylePrefix(queryStyle);
+ querySuffix = getParamStyleSuffix(queryStyle);
+ queryDelimiter = getParamStyleDelimiter(queryStyle, "tags", false);
if (tags.size() > 0) {
if (QString("csv").indexOf("multi") == 0) {
foreach (QString t, tags) {
if (fullPath.indexOf("?") > 0)
- fullPath.append("&");
+ fullPath.append(queryPrefix);
else
fullPath.append("?");
fullPath.append("tags=").append(::test_namespace::toStringValue(t));
@@ -334,28 +462,67 @@ void PFXPetApi::findPetsByTags(const QList &tags) {
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
- fullPath.append("?");
- fullPath.append("tags=");
+ fullPath.append("?").append(queryPrefix).append("tags").append(querySuffix);
qint32 count = 0;
foreach (QString t, tags) {
if (count > 0) {
- fullPath.append(" ");
+ fullPath.append((false)? queryDelimiter : QUrl::toPercentEncoding(queryDelimiter));
}
fullPath.append(::test_namespace::toStringValue(t));
+ count++;
}
} else if (QString("csv").indexOf("tsv") == 0) {
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
- fullPath.append("?");
- fullPath.append("tags=");
+ fullPath.append("?").append(queryPrefix).append("tags").append(querySuffix);
qint32 count = 0;
foreach (QString t, tags) {
if (count > 0) {
fullPath.append("\t");
}
fullPath.append(::test_namespace::toStringValue(t));
+ count++;
}
+ } else if (QString("csv").indexOf("csv") == 0) {
+ if (fullPath.indexOf("?") > 0)
+ fullPath.append("&");
+ else
+ fullPath.append("?").append(queryPrefix).append("tags").append(querySuffix);
+ qint32 count = 0;
+ foreach (QString t, tags) {
+ if (count > 0) {
+ fullPath.append(queryDelimiter);
+ }
+ fullPath.append(::test_namespace::toStringValue(t));
+ count++;
+ }
+ } else if (QString("csv").indexOf("pipes") == 0) {
+ if (fullPath.indexOf("?") > 0)
+ fullPath.append("&");
+ else
+ fullPath.append("?").append(queryPrefix).append("tags").append(querySuffix);
+ qint32 count = 0;
+ foreach (QString t, tags) {
+ if (count > 0) {
+ fullPath.append(queryDelimiter);
+ }
+ fullPath.append(::test_namespace::toStringValue(t));
+ count++;
+ }
+ } else if (QString("csv").indexOf("deepObject") == 0) {
+ if (fullPath.indexOf("?") > 0)
+ fullPath.append("&");
+ else
+ fullPath.append("?").append(queryPrefix).append("tags").append(querySuffix);
+ qint32 count = 0;
+ foreach (QString t, tags) {
+ if (count > 0) {
+ fullPath.append(queryDelimiter);
+ }
+ fullPath.append(::test_namespace::toStringValue(t));
+ count++;
+ }
}
}
@@ -405,14 +572,23 @@ void PFXPetApi::findPetsByTagsCallback(PFXHttpRequestWorker *worker) {
void PFXPetApi::getPetById(const qint64 &pet_id) {
QString fullPath = QString(_serverConfigs["getPetById"][_serverIndices.value("getPetById")].URL()+"/pet/{petId}");
- QString pet_idPathParam("{");
- pet_idPathParam.append("petId").append("}");
- fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id)));
if(_apiKeys.contains("api_key")){
addHeaders("api_key",_apiKeys.find("api_key").value());
}
+ QString pet_idPathParam("{");
+ pet_idPathParam.append("petId").append("}");
+ QString pathPrefix, pathSuffix, pathDelimiter;
+ QString pathStyle = "";
+ if(pathStyle == "")
+ pathStyle = "simple";
+ pathPrefix = getParamStylePrefix(pathStyle);
+ pathSuffix = getParamStyleSuffix(pathStyle);
+ pathDelimiter = getParamStyleDelimiter(pathStyle, "petId", false);
+ QString paramString = (pathStyle == "matrix") ? pathPrefix+"petId"+pathSuffix : pathPrefix;
+ fullPath.replace(pet_idPathParam, paramString+QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id)));
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
worker->setTimeOut(_timeOut);
@@ -451,6 +627,7 @@ void PFXPetApi::getPetByIdCallback(PFXHttpRequestWorker *worker) {
void PFXPetApi::updatePet(const PFXPet &body) {
QString fullPath = QString(_serverConfigs["updatePet"][_serverIndices.value("updatePet")].URL()+"/pet");
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
@@ -458,9 +635,8 @@ void PFXPetApi::updatePet(const PFXPet &body) {
worker->setWorkingDirectory(_workingDirectory);
PFXHttpRequestInput input(fullPath, "PUT");
- QString output = body.asJson();
- input.request_body.append(output.toUtf8());
-
+ QByteArray output = body.asJson().toUtf8();
+ input.request_body.append(output);
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::updatePetCallback);
@@ -492,19 +668,26 @@ void PFXPetApi::updatePetCallback(PFXHttpRequestWorker *worker) {
void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const QString &name, const QString &status) {
QString fullPath = QString(_serverConfigs["updatePetWithForm"][_serverIndices.value("updatePetWithForm")].URL()+"/pet/{petId}");
+
QString pet_idPathParam("{");
pet_idPathParam.append("petId").append("}");
- fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id)));
-
+ QString pathPrefix, pathSuffix, pathDelimiter;
+ QString pathStyle = "";
+ if(pathStyle == "")
+ pathStyle = "simple";
+ pathPrefix = getParamStylePrefix(pathStyle);
+ pathSuffix = getParamStyleSuffix(pathStyle);
+ pathDelimiter = getParamStyleDelimiter(pathStyle, "petId", false);
+ QString paramString = (pathStyle == "matrix") ? pathPrefix+"petId"+pathSuffix : pathPrefix;
+ fullPath.replace(pet_idPathParam, paramString+QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id)));
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
worker->setTimeOut(_timeOut);
worker->setWorkingDirectory(_workingDirectory);
PFXHttpRequestInput input(fullPath, "POST");
- input.add_var("name", ::test_namespace::toStringValue(name));
- input.add_var("status", ::test_namespace::toStringValue(status));
- foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
+ input.add_var("name", ::test_namespace::toStringValue(name)); input.add_var("status", ::test_namespace::toStringValue(status)); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::updatePetWithFormCallback);
connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater);
@@ -535,10 +718,19 @@ void PFXPetApi::updatePetWithFormCallback(PFXHttpRequestWorker *worker) {
void PFXPetApi::uploadFile(const qint64 &pet_id, const QString &additional_metadata, const PFXHttpFileElement &file) {
QString fullPath = QString(_serverConfigs["uploadFile"][_serverIndices.value("uploadFile")].URL()+"/pet/{petId}/uploadImage");
+
QString pet_idPathParam("{");
pet_idPathParam.append("petId").append("}");
- fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id)));
-
+ QString pathPrefix, pathSuffix, pathDelimiter;
+ QString pathStyle = "";
+ if(pathStyle == "")
+ pathStyle = "simple";
+ pathPrefix = getParamStylePrefix(pathStyle);
+ pathSuffix = getParamStyleSuffix(pathStyle);
+ pathDelimiter = getParamStyleDelimiter(pathStyle, "petId", false);
+ QString paramString = (pathStyle == "matrix") ? pathPrefix+"petId"+pathSuffix : pathPrefix;
+ fullPath.replace(pet_idPathParam, paramString+QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id)));
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
worker->setTimeOut(_timeOut);
@@ -546,8 +738,7 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const QString &additional_metad
PFXHttpRequestInput input(fullPath, "POST");
input.add_var("additionalMetadata", ::test_namespace::toStringValue(additional_metadata));
- input.add_file("file", file.local_filename, file.request_filename, file.mime_type);
- foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
+ input.add_file("file", file.local_filename, file.request_filename, file.mime_type); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::uploadFileCallback);
connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater);
diff --git a/samples/client/petstore/cpp-qt5/client/PFXPetApi.h b/samples/client/petstore/cpp-qt5/client/PFXPetApi.h
index 7c3e9b331f3e..c25c2229f1aa 100644
--- a/samples/client/petstore/cpp-qt5/client/PFXPetApi.h
+++ b/samples/client/petstore/cpp-qt5/client/PFXPetApi.h
@@ -53,6 +53,10 @@ class PFXPetApi : public QObject {
void enableRequestCompression();
void enableResponseCompression();
void abortRequests();
+ QString getParamStylePrefix(QString style);
+ QString getParamStyleSuffix(QString style);
+ QString getParamStyleDelimiter(QString style, QString name, bool isExplode);
+
void addPet(const PFXPet &body);
void deletePet(const qint64 &pet_id, const QString &api_key);
diff --git a/samples/client/petstore/cpp-qt5/client/PFXServerConfiguration.h b/samples/client/petstore/cpp-qt5/client/PFXServerConfiguration.h
index b619015428ce..cc5273b8226e 100644
--- a/samples/client/petstore/cpp-qt5/client/PFXServerConfiguration.h
+++ b/samples/client/petstore/cpp-qt5/client/PFXServerConfiguration.h
@@ -17,6 +17,7 @@
#include
#include
#include
+#include
#include "PFXServerVariable.h"
namespace test_namespace {
diff --git a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp
index 1dbc49ff86cf..6e0c01a90454 100644
--- a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp
+++ b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp
@@ -133,12 +133,83 @@ void PFXStoreApi::abortRequests(){
emit abortRequestsSignal();
}
+QString PFXStoreApi::getParamStylePrefix(QString style){
+
+ if(style == "matrix"){
+ return ";";
+ }else if(style == "label"){
+ return ".";
+ }else if(style == "form"){
+ return "&";
+ }else if(style == "simple"){
+ return "";
+ }else if(style == "spaceDelimited"){
+ return "&";
+ }else if(style == "pipeDelimited"){
+ return "&";
+ }else
+ return "none";
+}
+
+QString PFXStoreApi::getParamStyleSuffix(QString style){
+
+ if(style == "matrix"){
+ return "=";
+ }else if(style == "label"){
+ return "";
+ }else if(style == "form"){
+ return "=";
+ }else if(style == "simple"){
+ return "";
+ }else if(style == "spaceDelimited"){
+ return "=";
+ }else if(style == "pipeDelimited"){
+ return "=";
+ }else
+ return "none";
+}
+
+QString PFXStoreApi::getParamStyleDelimiter(QString style, QString name, bool isExplode){
+
+ if(style == "matrix"){
+ return (isExplode) ? ";" + name + "=" : ",";
+
+ }else if(style == "label"){
+ return (isExplode) ? "." : ",";
+
+ }else if(style == "form"){
+ return (isExplode) ? "&" + name + "=" : ",";
+
+ }else if(style == "simple"){
+ return ",";
+ }else if(style == "spaceDelimited"){
+ return (isExplode) ? "&" + name + "=" : " ";
+
+ }else if(style == "pipeDelimited"){
+ return (isExplode) ? "&" + name + "=" : "|";
+
+ }else if(style == "deepObject"){
+ return (isExplode) ? "&" : "none";
+
+ }else
+ return "none";
+}
+
void PFXStoreApi::deleteOrder(const QString &order_id) {
QString fullPath = QString(_serverConfigs["deleteOrder"][_serverIndices.value("deleteOrder")].URL()+"/store/order/{orderId}");
+
QString order_idPathParam("{");
order_idPathParam.append("orderId").append("}");
- fullPath.replace(order_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(order_id)));
-
+ QString pathPrefix, pathSuffix, pathDelimiter;
+ QString pathStyle = "";
+ if(pathStyle == "")
+ pathStyle = "simple";
+ pathPrefix = getParamStylePrefix(pathStyle);
+ pathSuffix = getParamStyleSuffix(pathStyle);
+ pathDelimiter = getParamStyleDelimiter(pathStyle, "orderId", false);
+ QString paramString = (pathStyle == "matrix") ? pathPrefix+"orderId"+pathSuffix : pathPrefix;
+ fullPath.replace(order_idPathParam, paramString+QUrl::toPercentEncoding(::test_namespace::toStringValue(order_id)));
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
worker->setTimeOut(_timeOut);
@@ -176,12 +247,13 @@ void PFXStoreApi::deleteOrderCallback(PFXHttpRequestWorker *worker) {
void PFXStoreApi::getInventory() {
QString fullPath = QString(_serverConfigs["getInventory"][_serverIndices.value("getInventory")].URL()+"/store/inventory");
-
+
if(_apiKeys.contains("api_key")){
addHeaders("api_key",_apiKeys.find("api_key").value());
}
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
worker->setTimeOut(_timeOut);
worker->setWorkingDirectory(_workingDirectory);
@@ -228,10 +300,19 @@ void PFXStoreApi::getInventoryCallback(PFXHttpRequestWorker *worker) {
void PFXStoreApi::getOrderById(const qint64 &order_id) {
QString fullPath = QString(_serverConfigs["getOrderById"][_serverIndices.value("getOrderById")].URL()+"/store/order/{orderId}");
+
QString order_idPathParam("{");
order_idPathParam.append("orderId").append("}");
- fullPath.replace(order_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(order_id)));
-
+ QString pathPrefix, pathSuffix, pathDelimiter;
+ QString pathStyle = "";
+ if(pathStyle == "")
+ pathStyle = "simple";
+ pathPrefix = getParamStylePrefix(pathStyle);
+ pathSuffix = getParamStyleSuffix(pathStyle);
+ pathDelimiter = getParamStyleDelimiter(pathStyle, "orderId", false);
+ QString paramString = (pathStyle == "matrix") ? pathPrefix+"orderId"+pathSuffix : pathPrefix;
+ fullPath.replace(order_idPathParam, paramString+QUrl::toPercentEncoding(::test_namespace::toStringValue(order_id)));
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
worker->setTimeOut(_timeOut);
@@ -270,6 +351,7 @@ void PFXStoreApi::getOrderByIdCallback(PFXHttpRequestWorker *worker) {
void PFXStoreApi::placeOrder(const PFXOrder &body) {
QString fullPath = QString(_serverConfigs["placeOrder"][_serverIndices.value("placeOrder")].URL()+"/store/order");
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
@@ -277,9 +359,8 @@ void PFXStoreApi::placeOrder(const PFXOrder &body) {
worker->setWorkingDirectory(_workingDirectory);
PFXHttpRequestInput input(fullPath, "POST");
- QString output = body.asJson();
- input.request_body.append(output.toUtf8());
-
+ QByteArray output = body.asJson().toUtf8();
+ input.request_body.append(output);
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::placeOrderCallback);
diff --git a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h
index d065169e181d..019ebf16646e 100644
--- a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h
+++ b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h
@@ -52,6 +52,10 @@ class PFXStoreApi : public QObject {
void enableRequestCompression();
void enableResponseCompression();
void abortRequests();
+ QString getParamStylePrefix(QString style);
+ QString getParamStyleSuffix(QString style);
+ QString getParamStyleDelimiter(QString style, QString name, bool isExplode);
+
void deleteOrder(const QString &order_id);
void getInventory();
diff --git a/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp
index aef910a0af9d..1e8c5ee58691 100644
--- a/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp
+++ b/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp
@@ -145,8 +145,71 @@ void PFXUserApi::abortRequests(){
emit abortRequestsSignal();
}
+QString PFXUserApi::getParamStylePrefix(QString style){
+
+ if(style == "matrix"){
+ return ";";
+ }else if(style == "label"){
+ return ".";
+ }else if(style == "form"){
+ return "&";
+ }else if(style == "simple"){
+ return "";
+ }else if(style == "spaceDelimited"){
+ return "&";
+ }else if(style == "pipeDelimited"){
+ return "&";
+ }else
+ return "none";
+}
+
+QString PFXUserApi::getParamStyleSuffix(QString style){
+
+ if(style == "matrix"){
+ return "=";
+ }else if(style == "label"){
+ return "";
+ }else if(style == "form"){
+ return "=";
+ }else if(style == "simple"){
+ return "";
+ }else if(style == "spaceDelimited"){
+ return "=";
+ }else if(style == "pipeDelimited"){
+ return "=";
+ }else
+ return "none";
+}
+
+QString PFXUserApi::getParamStyleDelimiter(QString style, QString name, bool isExplode){
+
+ if(style == "matrix"){
+ return (isExplode) ? ";" + name + "=" : ",";
+
+ }else if(style == "label"){
+ return (isExplode) ? "." : ",";
+
+ }else if(style == "form"){
+ return (isExplode) ? "&" + name + "=" : ",";
+
+ }else if(style == "simple"){
+ return ",";
+ }else if(style == "spaceDelimited"){
+ return (isExplode) ? "&" + name + "=" : " ";
+
+ }else if(style == "pipeDelimited"){
+ return (isExplode) ? "&" + name + "=" : "|";
+
+ }else if(style == "deepObject"){
+ return (isExplode) ? "&" : "none";
+
+ }else
+ return "none";
+}
+
void PFXUserApi::createUser(const PFXUser &body) {
QString fullPath = QString(_serverConfigs["createUser"][_serverIndices.value("createUser")].URL()+"/user");
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
@@ -154,9 +217,8 @@ void PFXUserApi::createUser(const PFXUser &body) {
worker->setWorkingDirectory(_workingDirectory);
PFXHttpRequestInput input(fullPath, "POST");
- QString output = body.asJson();
- input.request_body.append(output.toUtf8());
-
+ QByteArray output = body.asJson().toUtf8();
+ input.request_body.append(output);
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::createUserCallback);
@@ -188,6 +250,7 @@ void PFXUserApi::createUserCallback(PFXHttpRequestWorker *worker) {
void PFXUserApi::createUsersWithArrayInput(const QList &body) {
QString fullPath = QString(_serverConfigs["createUsersWithArrayInput"][_serverIndices.value("createUsersWithArrayInput")].URL()+"/user/createWithArray");
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
@@ -195,10 +258,10 @@ void PFXUserApi::createUsersWithArrayInput(const QList &body) {
worker->setWorkingDirectory(_workingDirectory);
PFXHttpRequestInput input(fullPath, "POST");
+
QJsonDocument doc(::test_namespace::toJsonValue(body).toArray());
QByteArray bytes = doc.toJson();
input.request_body.append(bytes);
-
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::createUsersWithArrayInputCallback);
@@ -230,6 +293,7 @@ void PFXUserApi::createUsersWithArrayInputCallback(PFXHttpRequestWorker *worker)
void PFXUserApi::createUsersWithListInput(const QList &body) {
QString fullPath = QString(_serverConfigs["createUsersWithListInput"][_serverIndices.value("createUsersWithListInput")].URL()+"/user/createWithList");
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
@@ -237,10 +301,10 @@ void PFXUserApi::createUsersWithListInput(const QList &body) {
worker->setWorkingDirectory(_workingDirectory);
PFXHttpRequestInput input(fullPath, "POST");
+
QJsonDocument doc(::test_namespace::toJsonValue(body).toArray());
QByteArray bytes = doc.toJson();
input.request_body.append(bytes);
-
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::createUsersWithListInputCallback);
@@ -272,10 +336,19 @@ void PFXUserApi::createUsersWithListInputCallback(PFXHttpRequestWorker *worker)
void PFXUserApi::deleteUser(const QString &username) {
QString fullPath = QString(_serverConfigs["deleteUser"][_serverIndices.value("deleteUser")].URL()+"/user/{username}");
+
QString usernamePathParam("{");
usernamePathParam.append("username").append("}");
- fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(username)));
-
+ QString pathPrefix, pathSuffix, pathDelimiter;
+ QString pathStyle = "";
+ if(pathStyle == "")
+ pathStyle = "simple";
+ pathPrefix = getParamStylePrefix(pathStyle);
+ pathSuffix = getParamStyleSuffix(pathStyle);
+ pathDelimiter = getParamStyleDelimiter(pathStyle, "username", false);
+ QString paramString = (pathStyle == "matrix") ? pathPrefix+"username"+pathSuffix : pathPrefix;
+ fullPath.replace(usernamePathParam, paramString+QUrl::toPercentEncoding(::test_namespace::toStringValue(username)));
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
worker->setTimeOut(_timeOut);
@@ -313,10 +386,19 @@ void PFXUserApi::deleteUserCallback(PFXHttpRequestWorker *worker) {
void PFXUserApi::getUserByName(const QString &username) {
QString fullPath = QString(_serverConfigs["getUserByName"][_serverIndices.value("getUserByName")].URL()+"/user/{username}");
+
QString usernamePathParam("{");
usernamePathParam.append("username").append("}");
- fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(username)));
-
+ QString pathPrefix, pathSuffix, pathDelimiter;
+ QString pathStyle = "";
+ if(pathStyle == "")
+ pathStyle = "simple";
+ pathPrefix = getParamStylePrefix(pathStyle);
+ pathSuffix = getParamStyleSuffix(pathStyle);
+ pathDelimiter = getParamStyleDelimiter(pathStyle, "username", false);
+ QString paramString = (pathStyle == "matrix") ? pathPrefix+"username"+pathSuffix : pathPrefix;
+ fullPath.replace(usernamePathParam, paramString+QUrl::toPercentEncoding(::test_namespace::toStringValue(username)));
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
worker->setTimeOut(_timeOut);
@@ -355,19 +437,33 @@ void PFXUserApi::getUserByNameCallback(PFXHttpRequestWorker *worker) {
void PFXUserApi::loginUser(const QString &username, const QString &password) {
QString fullPath = QString(_serverConfigs["loginUser"][_serverIndices.value("loginUser")].URL()+"/user/login");
+
-
+ QString queryPrefix, querySuffix, queryDelimiter, queryStyle;
+ queryStyle = "";
+ if(queryStyle == "")
+ queryStyle = "form";
+ queryPrefix = getParamStylePrefix(queryStyle);
+ querySuffix = getParamStyleSuffix(queryStyle);
+ queryDelimiter = getParamStyleDelimiter(queryStyle, "username", false);
if (fullPath.indexOf("?") > 0)
- fullPath.append("&");
+ fullPath.append(queryPrefix);
else
fullPath.append("?");
- fullPath.append(QUrl::toPercentEncoding("username")).append("=").append(QUrl::toPercentEncoding(::test_namespace::toStringValue(username)));
+ fullPath.append(QUrl::toPercentEncoding("username")).append(querySuffix).append(QUrl::toPercentEncoding(::test_namespace::toStringValue(username)));
+ queryStyle = "";
+ if(queryStyle == "")
+ queryStyle = "form";
+ queryPrefix = getParamStylePrefix(queryStyle);
+ querySuffix = getParamStyleSuffix(queryStyle);
+ queryDelimiter = getParamStyleDelimiter(queryStyle, "password", false);
if (fullPath.indexOf("?") > 0)
- fullPath.append("&");
+ fullPath.append(queryPrefix);
else
fullPath.append("?");
- fullPath.append(QUrl::toPercentEncoding("password")).append("=").append(QUrl::toPercentEncoding(::test_namespace::toStringValue(password)));
+
+ fullPath.append(QUrl::toPercentEncoding("password")).append(querySuffix).append(QUrl::toPercentEncoding(::test_namespace::toStringValue(password)));
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
worker->setTimeOut(_timeOut);
@@ -407,6 +503,7 @@ void PFXUserApi::loginUserCallback(PFXHttpRequestWorker *worker) {
void PFXUserApi::logoutUser() {
QString fullPath = QString(_serverConfigs["logoutUser"][_serverIndices.value("logoutUser")].URL()+"/user/logout");
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
@@ -445,19 +542,27 @@ void PFXUserApi::logoutUserCallback(PFXHttpRequestWorker *worker) {
void PFXUserApi::updateUser(const QString &username, const PFXUser &body) {
QString fullPath = QString(_serverConfigs["updateUser"][_serverIndices.value("updateUser")].URL()+"/user/{username}");
+
QString usernamePathParam("{");
usernamePathParam.append("username").append("}");
- fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(username)));
-
+ QString pathPrefix, pathSuffix, pathDelimiter;
+ QString pathStyle = "";
+ if(pathStyle == "")
+ pathStyle = "simple";
+ pathPrefix = getParamStylePrefix(pathStyle);
+ pathSuffix = getParamStyleSuffix(pathStyle);
+ pathDelimiter = getParamStyleDelimiter(pathStyle, "username", false);
+ QString paramString = (pathStyle == "matrix") ? pathPrefix+"username"+pathSuffix : pathPrefix;
+ fullPath.replace(usernamePathParam, paramString+QUrl::toPercentEncoding(::test_namespace::toStringValue(username)));
+
PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this, _manager);
worker->setTimeOut(_timeOut);
worker->setWorkingDirectory(_workingDirectory);
PFXHttpRequestInput input(fullPath, "PUT");
- QString output = body.asJson();
- input.request_body.append(output.toUtf8());
-
+ QByteArray output = body.asJson().toUtf8();
+ input.request_body.append(output);
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::updateUserCallback);
diff --git a/samples/client/petstore/cpp-qt5/client/PFXUserApi.h b/samples/client/petstore/cpp-qt5/client/PFXUserApi.h
index aada5d8f3bf4..a27da6bc09b4 100644
--- a/samples/client/petstore/cpp-qt5/client/PFXUserApi.h
+++ b/samples/client/petstore/cpp-qt5/client/PFXUserApi.h
@@ -52,6 +52,10 @@ class PFXUserApi : public QObject {
void enableRequestCompression();
void enableResponseCompression();
void abortRequests();
+ QString getParamStylePrefix(QString style);
+ QString getParamStyleSuffix(QString style);
+ QString getParamStyleDelimiter(QString style, QString name, bool isExplode);
+
void createUser(const PFXUser &body);
void createUsersWithArrayInput(const QList &body);
diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/api_client.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/api_client.dart
index 79394cc83357..6a45211ea6e1 100644
--- a/samples/client/petstore/dart2/petstore_client_lib/lib/api_client.dart
+++ b/samples/client/petstore/dart2/petstore_client_lib/lib/api_client.dart
@@ -42,6 +42,13 @@ class ApiClient {
_defaultHeaderMap[key] = value;
}
+ Map get defaultHeaderMap => _defaultHeaderMap;
+
+ /// returns an unmodifiable view of the authentications, since none should be added
+ /// nor deleted
+ Map get authentications =>
+ Map.unmodifiable(_authentications);
+
dynamic deserialize(String json, String targetType, {bool growable}) {
// Remove all spaces. Necessary for reg expressions as well.
targetType = targetType.replaceAll(' ', '');
diff --git a/samples/client/petstore/java/jersey1/.openapi-generator/FILES b/samples/client/petstore/java/jersey1/.openapi-generator/FILES
index 1c6e0a38c6eb..d4c19c164b8f 100644
--- a/samples/client/petstore/java/jersey1/.openapi-generator/FILES
+++ b/samples/client/petstore/java/jersey1/.openapi-generator/FILES
@@ -69,6 +69,7 @@ src/main/java/org/openapitools/client/ApiClient.java
src/main/java/org/openapitools/client/ApiException.java
src/main/java/org/openapitools/client/Configuration.java
src/main/java/org/openapitools/client/CustomInstantDeserializer.java
+src/main/java/org/openapitools/client/JavaTimeFormatter.java
src/main/java/org/openapitools/client/Pair.java
src/main/java/org/openapitools/client/RFC3339DateFormat.java
src/main/java/org/openapitools/client/ServerConfiguration.java
diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ApiClient.java
index f5748ef44075..d0f11019fb7e 100644
--- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ApiClient.java
+++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ApiClient.java
@@ -59,7 +59,7 @@
import org.openapitools.client.auth.OAuth;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
-public class ApiClient {
+public class ApiClient extends JavaTimeFormatter {
private Map defaultHeaderMap = new HashMap();
private Map defaultCookieMap = new HashMap();
private String basePath = "http://petstore.swagger.io:80/v2";
@@ -443,6 +443,8 @@ public String parameterToString(Object param) {
return "";
} else if (param instanceof Date) {
return formatDate((Date) param);
+ } else if (param instanceof OffsetDateTime) {
+ return formatOffsetDateTime((OffsetDateTime) param);
} else if (param instanceof Collection) {
StringBuilder b = new StringBuilder();
for(Object o : (Collection>)param) {
diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/JavaTimeFormatter.java
new file mode 100644
index 000000000000..12383cdea06c
--- /dev/null
+++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/JavaTimeFormatter.java
@@ -0,0 +1,64 @@
+/*
+ * 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 org.threeten.bp.OffsetDateTime;
+import org.threeten.bp.format.DateTimeFormatter;
+import org.threeten.bp.format.DateTimeParseException;
+
+/**
+ * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class.
+ * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}.
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class JavaTimeFormatter {
+
+ private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
+
+ /**
+ * Get the date format used to parse/format {@code OffsetDateTime} parameters.
+ * @return DateTimeFormatter
+ */
+ public DateTimeFormatter getOffsetDateTimeFormatter() {
+ return offsetDateTimeFormatter;
+ }
+
+ /**
+ * Set the date format used to parse/format {@code OffsetDateTime} parameters.
+ * @param offsetDateTimeFormatter {@code DateTimeFormatter}
+ */
+ public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) {
+ this.offsetDateTimeFormatter = offsetDateTimeFormatter;
+ }
+
+ /**
+ * Parse the given string into {@code OffsetDateTime} object.
+ * @param str String
+ * @return {@code OffsetDateTime}
+ */
+ public OffsetDateTime parseOffsetDateTime(String str) {
+ try {
+ return OffsetDateTime.parse(str, offsetDateTimeFormatter);
+ } catch (DateTimeParseException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ /**
+ * Format the given {@code OffsetDateTime} object into string.
+ * @param offsetDateTime {@code OffsetDateTime}
+ * @return {@code OffsetDateTime} in string format
+ */
+ public String formatOffsetDateTime(OffsetDateTime offsetDateTime) {
+ return offsetDateTimeFormatter.format(offsetDateTime);
+ }
+}
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/.gitignore b/samples/client/petstore/java/jersey2-java8-localdatetime/.gitignore
new file mode 100644
index 000000000000..a530464afa1b
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/.gitignore
@@ -0,0 +1,21 @@
+*.class
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.ear
+
+# exclude jar for gradle wrapper
+!gradle/wrapper/*.jar
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+
+# build files
+**/target
+target
+.gradle
+build
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator-ignore b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator-ignore
new file mode 100644
index 000000000000..7484ee590a38
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/FILES b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/FILES
new file mode 100644
index 000000000000..2d4a06729dd9
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/FILES
@@ -0,0 +1,137 @@
+.gitignore
+.travis.yml
+README.md
+api/openapi.yaml
+build.gradle
+build.sbt
+docs/AdditionalPropertiesAnyType.md
+docs/AdditionalPropertiesArray.md
+docs/AdditionalPropertiesBoolean.md
+docs/AdditionalPropertiesClass.md
+docs/AdditionalPropertiesInteger.md
+docs/AdditionalPropertiesNumber.md
+docs/AdditionalPropertiesObject.md
+docs/AdditionalPropertiesString.md
+docs/Animal.md
+docs/AnotherFakeApi.md
+docs/ArrayOfArrayOfNumberOnly.md
+docs/ArrayOfNumberOnly.md
+docs/ArrayTest.md
+docs/BigCat.md
+docs/BigCatAllOf.md
+docs/Capitalization.md
+docs/Cat.md
+docs/CatAllOf.md
+docs/Category.md
+docs/ClassModel.md
+docs/Client.md
+docs/Dog.md
+docs/DogAllOf.md
+docs/EnumArrays.md
+docs/EnumClass.md
+docs/EnumTest.md
+docs/FakeApi.md
+docs/FakeClassnameTags123Api.md
+docs/FileSchemaTestClass.md
+docs/FormatTest.md
+docs/HasOnlyReadOnly.md
+docs/MapTest.md
+docs/MixedPropertiesAndAdditionalPropertiesClass.md
+docs/Model200Response.md
+docs/ModelApiResponse.md
+docs/ModelReturn.md
+docs/Name.md
+docs/NumberOnly.md
+docs/Order.md
+docs/OuterComposite.md
+docs/OuterEnum.md
+docs/Pet.md
+docs/PetApi.md
+docs/ReadOnlyFirst.md
+docs/SpecialModelName.md
+docs/StoreApi.md
+docs/Tag.md
+docs/TypeHolderDefault.md
+docs/TypeHolderExample.md
+docs/User.md
+docs/UserApi.md
+docs/XmlItem.md
+git_push.sh
+gradle.properties
+gradle/wrapper/gradle-wrapper.jar
+gradle/wrapper/gradle-wrapper.properties
+gradlew
+gradlew.bat
+pom.xml
+settings.gradle
+src/main/AndroidManifest.xml
+src/main/java/org/openapitools/client/ApiClient.java
+src/main/java/org/openapitools/client/ApiException.java
+src/main/java/org/openapitools/client/ApiResponse.java
+src/main/java/org/openapitools/client/Configuration.java
+src/main/java/org/openapitools/client/JSON.java
+src/main/java/org/openapitools/client/JavaTimeFormatter.java
+src/main/java/org/openapitools/client/Pair.java
+src/main/java/org/openapitools/client/RFC3339DateFormat.java
+src/main/java/org/openapitools/client/ServerConfiguration.java
+src/main/java/org/openapitools/client/ServerVariable.java
+src/main/java/org/openapitools/client/StringUtil.java
+src/main/java/org/openapitools/client/api/AnotherFakeApi.java
+src/main/java/org/openapitools/client/api/FakeApi.java
+src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java
+src/main/java/org/openapitools/client/api/PetApi.java
+src/main/java/org/openapitools/client/api/StoreApi.java
+src/main/java/org/openapitools/client/api/UserApi.java
+src/main/java/org/openapitools/client/auth/ApiKeyAuth.java
+src/main/java/org/openapitools/client/auth/Authentication.java
+src/main/java/org/openapitools/client/auth/HttpBasicAuth.java
+src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
+src/main/java/org/openapitools/client/auth/OAuth.java
+src/main/java/org/openapitools/client/auth/OAuthFlow.java
+src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java
+src/main/java/org/openapitools/client/model/Animal.java
+src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java
+src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java
+src/main/java/org/openapitools/client/model/ArrayTest.java
+src/main/java/org/openapitools/client/model/BigCat.java
+src/main/java/org/openapitools/client/model/BigCatAllOf.java
+src/main/java/org/openapitools/client/model/Capitalization.java
+src/main/java/org/openapitools/client/model/Cat.java
+src/main/java/org/openapitools/client/model/CatAllOf.java
+src/main/java/org/openapitools/client/model/Category.java
+src/main/java/org/openapitools/client/model/ClassModel.java
+src/main/java/org/openapitools/client/model/Client.java
+src/main/java/org/openapitools/client/model/Dog.java
+src/main/java/org/openapitools/client/model/DogAllOf.java
+src/main/java/org/openapitools/client/model/EnumArrays.java
+src/main/java/org/openapitools/client/model/EnumClass.java
+src/main/java/org/openapitools/client/model/EnumTest.java
+src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
+src/main/java/org/openapitools/client/model/FormatTest.java
+src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java
+src/main/java/org/openapitools/client/model/MapTest.java
+src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
+src/main/java/org/openapitools/client/model/Model200Response.java
+src/main/java/org/openapitools/client/model/ModelApiResponse.java
+src/main/java/org/openapitools/client/model/ModelReturn.java
+src/main/java/org/openapitools/client/model/Name.java
+src/main/java/org/openapitools/client/model/NumberOnly.java
+src/main/java/org/openapitools/client/model/Order.java
+src/main/java/org/openapitools/client/model/OuterComposite.java
+src/main/java/org/openapitools/client/model/OuterEnum.java
+src/main/java/org/openapitools/client/model/Pet.java
+src/main/java/org/openapitools/client/model/ReadOnlyFirst.java
+src/main/java/org/openapitools/client/model/SpecialModelName.java
+src/main/java/org/openapitools/client/model/Tag.java
+src/main/java/org/openapitools/client/model/TypeHolderDefault.java
+src/main/java/org/openapitools/client/model/TypeHolderExample.java
+src/main/java/org/openapitools/client/model/User.java
+src/main/java/org/openapitools/client/model/XmlItem.java
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION
new file mode 100644
index 000000000000..3fa3b389a57d
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION
@@ -0,0 +1 @@
+5.0.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/.travis.yml b/samples/client/petstore/java/jersey2-java8-localdatetime/.travis.yml
new file mode 100644
index 000000000000..1b6741c083c7
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/.travis.yml
@@ -0,0 +1,22 @@
+#
+# Generated by OpenAPI Generator: https://openapi-generator.tech
+#
+# Ref: https://docs.travis-ci.com/user/languages/java/
+#
+language: java
+jdk:
+ - openjdk12
+ - openjdk11
+ - openjdk10
+ - openjdk9
+ - openjdk8
+before_install:
+ # ensure gradlew has proper permission
+ - chmod a+x ./gradlew
+script:
+ # test using maven
+ #- mvn test
+ # test using gradle
+ - gradle test
+ # test using sbt
+ # - sbt test
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/README.md b/samples/client/petstore/java/jersey2-java8-localdatetime/README.md
new file mode 100644
index 000000000000..290284ac5db8
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/README.md
@@ -0,0 +1,263 @@
+# petstore-jersey2-java8-localdatetime
+
+OpenAPI Petstore
+
+- API version: 1.0.0
+
+This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+
+*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
+
+## Requirements
+
+Building the API client library requires:
+
+1. Java 1.8+
+2. Maven/Gradle
+
+## Installation
+
+To install the API client library to your local Maven repository, simply execute:
+
+```shell
+mvn clean install
+```
+
+To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
+
+```shell
+mvn clean deploy
+```
+
+Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
+
+### Maven users
+
+Add this dependency to your project's POM:
+
+```xml
+
+ org.openapitools
+ petstore-jersey2-java8-localdatetime
+ 1.0.0
+ compile
+
+```
+
+### Gradle users
+
+Add this dependency to your project's build file:
+
+```groovy
+compile "org.openapitools:petstore-jersey2-java8-localdatetime:1.0.0"
+```
+
+### Others
+
+At first generate the JAR by executing:
+
+```shell
+mvn clean package
+```
+
+Then manually install the following JARs:
+
+- `target/petstore-jersey2-java8-localdatetime-1.0.0.jar`
+- `target/lib/*.jar`
+
+## Usage
+
+To add a HTTP proxy for the API client, use `ClientConfig`:
+```java
+
+import org.glassfish.jersey.apache.connector.ApacheConnectorProvider;
+import org.glassfish.jersey.client.ClientConfig;
+import org.glassfish.jersey.client.ClientProperties;
+import org.openapitools.client.*;
+import org.openapitools.client.api.AnotherFakeApi;
+
+...
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+ClientConfig clientConfig = defaultClient.getClientConfig();
+clientConfig.connectorProvider(new ApacheConnectorProvider());
+clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here");
+clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username");
+clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password");
+defaultClient.setClientConfig(clientConfig);
+
+AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient);
+
+```
+
+## Getting Started
+
+Please follow the [installation](#installation) instruction and execute the following Java code:
+
+```java
+
+import org.openapitools.client.*;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.AnotherFakeApi;
+
+public class AnotherFakeApiExample {
+
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient);
+ Client body = new Client(); // Client | client model
+ try {
+ Client result = apiInstance.call123testSpecialTags(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
+*FakeApi* | [**createXmlItem**](docs/FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem
+*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
+*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
+*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
+*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
+*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
+*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
+*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
+*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
+*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
+*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
+*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
+*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters |
+*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
+*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
+*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
+*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
+*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
+*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
+*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
+*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
+*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
+*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
+*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
+*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
+*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
+*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user
+*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
+*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
+*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
+*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
+*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
+*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
+*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
+
+
+## Documentation for Models
+
+ - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md)
+ - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md)
+ - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md)
+ - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
+ - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md)
+ - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md)
+ - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md)
+ - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md)
+ - [Animal](docs/Animal.md)
+ - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
+ - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
+ - [ArrayTest](docs/ArrayTest.md)
+ - [BigCat](docs/BigCat.md)
+ - [BigCatAllOf](docs/BigCatAllOf.md)
+ - [Capitalization](docs/Capitalization.md)
+ - [Cat](docs/Cat.md)
+ - [CatAllOf](docs/CatAllOf.md)
+ - [Category](docs/Category.md)
+ - [ClassModel](docs/ClassModel.md)
+ - [Client](docs/Client.md)
+ - [Dog](docs/Dog.md)
+ - [DogAllOf](docs/DogAllOf.md)
+ - [EnumArrays](docs/EnumArrays.md)
+ - [EnumClass](docs/EnumClass.md)
+ - [EnumTest](docs/EnumTest.md)
+ - [FileSchemaTestClass](docs/FileSchemaTestClass.md)
+ - [FormatTest](docs/FormatTest.md)
+ - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
+ - [MapTest](docs/MapTest.md)
+ - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
+ - [Model200Response](docs/Model200Response.md)
+ - [ModelApiResponse](docs/ModelApiResponse.md)
+ - [ModelReturn](docs/ModelReturn.md)
+ - [Name](docs/Name.md)
+ - [NumberOnly](docs/NumberOnly.md)
+ - [Order](docs/Order.md)
+ - [OuterComposite](docs/OuterComposite.md)
+ - [OuterEnum](docs/OuterEnum.md)
+ - [Pet](docs/Pet.md)
+ - [ReadOnlyFirst](docs/ReadOnlyFirst.md)
+ - [SpecialModelName](docs/SpecialModelName.md)
+ - [Tag](docs/Tag.md)
+ - [TypeHolderDefault](docs/TypeHolderDefault.md)
+ - [TypeHolderExample](docs/TypeHolderExample.md)
+ - [User](docs/User.md)
+ - [XmlItem](docs/XmlItem.md)
+
+
+## Documentation for Authorization
+
+Authentication schemes defined for the API:
+### api_key
+
+
+- **Type**: API key
+- **API key parameter name**: api_key
+- **Location**: HTTP header
+
+### api_key_query
+
+
+- **Type**: API key
+- **API key parameter name**: api_key_query
+- **Location**: URL query string
+
+### http_basic_test
+
+
+- **Type**: HTTP basic authentication
+
+### petstore_auth
+
+
+- **Type**: OAuth
+- **Flow**: implicit
+- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
+- **Scopes**:
+ - write:pets: modify pets in your account
+ - read:pets: read your pets
+
+
+## Recommendation
+
+It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
+
+## Author
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/api/openapi.yaml b/samples/client/petstore/java/jersey2-java8-localdatetime/api/openapi.yaml
new file mode 100644
index 000000000000..0b3ef3a11c93
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/api/openapi.yaml
@@ -0,0 +1,2191 @@
+openapi: 3.0.1
+info:
+ description: 'This spec is mainly for testing Petstore server and contains fake
+ endpoints, models. Please do not use this for any other purpose. Special characters:
+ " \'
+ license:
+ name: Apache-2.0
+ url: https://www.apache.org/licenses/LICENSE-2.0.html
+ title: OpenAPI Petstore
+ version: 1.0.0
+servers:
+- url: http://petstore.swagger.io:80/v2
+tags:
+- description: Everything about your Pets
+ name: pet
+- description: Access to Petstore orders
+ name: store
+- description: Operations about user
+ name: user
+paths:
+ /pet:
+ post:
+ operationId: addPet
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ description: Pet object that needs to be added to the store
+ required: true
+ responses:
+ "200":
+ content: {}
+ description: successful operation
+ "405":
+ content: {}
+ description: Invalid input
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: Add a new pet to the store
+ tags:
+ - pet
+ x-codegen-request-body-name: body
+ x-contentType: application/json
+ x-accepts: application/json
+ put:
+ operationId: updatePet
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ description: Pet object that needs to be added to the store
+ required: true
+ responses:
+ "200":
+ content: {}
+ description: successful operation
+ "400":
+ content: {}
+ description: Invalid ID supplied
+ "404":
+ content: {}
+ description: Pet not found
+ "405":
+ content: {}
+ description: Validation exception
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: Update an existing pet
+ tags:
+ - pet
+ x-codegen-request-body-name: body
+ x-contentType: application/json
+ x-accepts: application/json
+ /pet/findByStatus:
+ get:
+ description: Multiple status values can be provided with comma separated strings
+ operationId: findPetsByStatus
+ parameters:
+ - description: Status values that need to be considered for filter
+ explode: false
+ in: query
+ name: status
+ required: true
+ schema:
+ items:
+ default: available
+ enum:
+ - available
+ - pending
+ - sold
+ type: string
+ type: array
+ style: form
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ items:
+ $ref: '#/components/schemas/Pet'
+ type: array
+ application/json:
+ schema:
+ items:
+ $ref: '#/components/schemas/Pet'
+ type: array
+ description: successful operation
+ "400":
+ content: {}
+ description: Invalid status value
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: Finds Pets by status
+ tags:
+ - pet
+ x-accepts: application/json
+ /pet/findByTags:
+ get:
+ deprecated: true
+ description: Multiple tags can be provided with comma separated strings. Use
+ tag1, tag2, tag3 for testing.
+ operationId: findPetsByTags
+ parameters:
+ - description: Tags to filter by
+ explode: false
+ in: query
+ name: tags
+ required: true
+ schema:
+ items:
+ type: string
+ type: array
+ uniqueItems: true
+ style: form
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ items:
+ $ref: '#/components/schemas/Pet'
+ type: array
+ uniqueItems: true
+ application/json:
+ schema:
+ items:
+ $ref: '#/components/schemas/Pet'
+ type: array
+ uniqueItems: true
+ description: successful operation
+ "400":
+ content: {}
+ description: Invalid tag value
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: Finds Pets by tags
+ tags:
+ - pet
+ x-accepts: application/json
+ /pet/{petId}:
+ delete:
+ operationId: deletePet
+ parameters:
+ - in: header
+ name: api_key
+ schema:
+ type: string
+ - description: Pet id to delete
+ in: path
+ name: petId
+ required: true
+ schema:
+ format: int64
+ type: integer
+ responses:
+ "200":
+ content: {}
+ description: successful operation
+ "400":
+ content: {}
+ description: Invalid pet value
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: Deletes a pet
+ tags:
+ - pet
+ x-accepts: application/json
+ get:
+ description: Returns a single pet
+ operationId: getPetById
+ parameters:
+ - description: ID of pet to return
+ in: path
+ name: petId
+ required: true
+ schema:
+ format: int64
+ type: integer
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ description: successful operation
+ "400":
+ content: {}
+ description: Invalid ID supplied
+ "404":
+ content: {}
+ description: Pet not found
+ security:
+ - api_key: []
+ summary: Find pet by ID
+ tags:
+ - pet
+ x-accepts: application/json
+ post:
+ operationId: updatePetWithForm
+ parameters:
+ - description: ID of pet that needs to be updated
+ in: path
+ name: petId
+ required: true
+ schema:
+ format: int64
+ type: integer
+ requestBody:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ properties:
+ name:
+ description: Updated name of the pet
+ type: string
+ status:
+ description: Updated status of the pet
+ type: string
+ responses:
+ "405":
+ content: {}
+ description: Invalid input
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: Updates a pet in the store with form data
+ tags:
+ - pet
+ x-contentType: application/x-www-form-urlencoded
+ x-accepts: application/json
+ /pet/{petId}/uploadImage:
+ post:
+ operationId: uploadFile
+ parameters:
+ - description: ID of pet to update
+ in: path
+ name: petId
+ required: true
+ schema:
+ format: int64
+ type: integer
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ properties:
+ additionalMetadata:
+ description: Additional data to pass to server
+ type: string
+ file:
+ description: file to upload
+ format: binary
+ type: string
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiResponse'
+ description: successful operation
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: uploads an image
+ tags:
+ - pet
+ x-contentType: multipart/form-data
+ x-accepts: application/json
+ /store/inventory:
+ get:
+ description: Returns a map of status codes to quantities
+ operationId: getInventory
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties:
+ format: int32
+ type: integer
+ type: object
+ description: successful operation
+ security:
+ - api_key: []
+ summary: Returns pet inventories by status
+ tags:
+ - store
+ x-accepts: application/json
+ /store/order:
+ post:
+ operationId: placeOrder
+ requestBody:
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/Order'
+ description: order placed for purchasing the pet
+ required: true
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Order'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Order'
+ description: successful operation
+ "400":
+ content: {}
+ description: Invalid Order
+ summary: Place an order for a pet
+ tags:
+ - store
+ x-codegen-request-body-name: body
+ x-contentType: '*/*'
+ x-accepts: application/json
+ /store/order/{order_id}:
+ delete:
+ description: For valid response try integer IDs with value < 1000. Anything
+ above 1000 or nonintegers will generate API errors
+ operationId: deleteOrder
+ parameters:
+ - description: ID of the order that needs to be deleted
+ in: path
+ name: order_id
+ required: true
+ schema:
+ type: string
+ responses:
+ "400":
+ content: {}
+ description: Invalid ID supplied
+ "404":
+ content: {}
+ description: Order not found
+ summary: Delete purchase order by ID
+ tags:
+ - store
+ x-accepts: application/json
+ get:
+ description: For valid response try integer IDs with value <= 5 or > 10. Other
+ values will generated exceptions
+ operationId: getOrderById
+ parameters:
+ - description: ID of pet that needs to be fetched
+ in: path
+ name: order_id
+ required: true
+ schema:
+ format: int64
+ maximum: 5
+ minimum: 1
+ type: integer
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Order'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Order'
+ description: successful operation
+ "400":
+ content: {}
+ description: Invalid ID supplied
+ "404":
+ content: {}
+ description: Order not found
+ summary: Find purchase order by ID
+ tags:
+ - store
+ x-accepts: application/json
+ /user:
+ post:
+ description: This can only be done by the logged in user.
+ operationId: createUser
+ requestBody:
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/User'
+ description: Created user object
+ required: true
+ responses:
+ default:
+ content: {}
+ description: successful operation
+ summary: Create user
+ tags:
+ - user
+ x-codegen-request-body-name: body
+ x-contentType: '*/*'
+ x-accepts: application/json
+ /user/createWithArray:
+ post:
+ operationId: createUsersWithArrayInput
+ requestBody:
+ content:
+ '*/*':
+ schema:
+ items:
+ $ref: '#/components/schemas/User'
+ type: array
+ description: List of user object
+ required: true
+ responses:
+ default:
+ content: {}
+ description: successful operation
+ summary: Creates list of users with given input array
+ tags:
+ - user
+ x-codegen-request-body-name: body
+ x-contentType: '*/*'
+ x-accepts: application/json
+ /user/createWithList:
+ post:
+ operationId: createUsersWithListInput
+ requestBody:
+ content:
+ '*/*':
+ schema:
+ items:
+ $ref: '#/components/schemas/User'
+ type: array
+ description: List of user object
+ required: true
+ responses:
+ default:
+ content: {}
+ description: successful operation
+ summary: Creates list of users with given input array
+ tags:
+ - user
+ x-codegen-request-body-name: body
+ x-contentType: '*/*'
+ x-accepts: application/json
+ /user/login:
+ get:
+ operationId: loginUser
+ parameters:
+ - description: The user name for login
+ in: query
+ name: username
+ required: true
+ schema:
+ type: string
+ - description: The password for login in clear text
+ in: query
+ name: password
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ type: string
+ application/json:
+ schema:
+ type: string
+ description: successful operation
+ headers:
+ X-Rate-Limit:
+ description: calls per hour allowed by the user
+ schema:
+ format: int32
+ type: integer
+ X-Expires-After:
+ description: date in UTC when token expires
+ schema:
+ format: date-time
+ type: string
+ "400":
+ content: {}
+ description: Invalid username/password supplied
+ summary: Logs user into the system
+ tags:
+ - user
+ x-accepts: application/json
+ /user/logout:
+ get:
+ operationId: logoutUser
+ responses:
+ default:
+ content: {}
+ description: successful operation
+ summary: Logs out current logged in user session
+ tags:
+ - user
+ x-accepts: application/json
+ /user/{username}:
+ delete:
+ description: This can only be done by the logged in user.
+ operationId: deleteUser
+ parameters:
+ - description: The name that needs to be deleted
+ in: path
+ name: username
+ required: true
+ schema:
+ type: string
+ responses:
+ "400":
+ content: {}
+ description: Invalid username supplied
+ "404":
+ content: {}
+ description: User not found
+ summary: Delete user
+ tags:
+ - user
+ x-accepts: application/json
+ get:
+ operationId: getUserByName
+ parameters:
+ - description: The name that needs to be fetched. Use user1 for testing.
+ in: path
+ name: username
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/User'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/User'
+ description: successful operation
+ "400":
+ content: {}
+ description: Invalid username supplied
+ "404":
+ content: {}
+ description: User not found
+ summary: Get user by user name
+ tags:
+ - user
+ x-accepts: application/json
+ put:
+ description: This can only be done by the logged in user.
+ operationId: updateUser
+ parameters:
+ - description: name that need to be deleted
+ in: path
+ name: username
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/User'
+ description: Updated user object
+ required: true
+ responses:
+ "400":
+ content: {}
+ description: Invalid user supplied
+ "404":
+ content: {}
+ description: User not found
+ summary: Updated user
+ tags:
+ - user
+ x-codegen-request-body-name: body
+ x-contentType: '*/*'
+ x-accepts: application/json
+ /fake_classname_test:
+ patch:
+ description: To test class name in snake case
+ operationId: testClassname
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Client'
+ description: client model
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Client'
+ description: successful operation
+ security:
+ - api_key_query: []
+ summary: To test class name in snake case
+ tags:
+ - fake_classname_tags 123#$%^
+ x-codegen-request-body-name: body
+ x-contentType: application/json
+ x-accepts: application/json
+ /fake:
+ delete:
+ description: Fake endpoint to test group parameters (optional)
+ operationId: testGroupParameters
+ parameters:
+ - description: Required String in group parameters
+ in: query
+ name: required_string_group
+ required: true
+ schema:
+ type: integer
+ - description: Required Boolean in group parameters
+ in: header
+ name: required_boolean_group
+ required: true
+ schema:
+ type: boolean
+ - description: Required Integer in group parameters
+ in: query
+ name: required_int64_group
+ required: true
+ schema:
+ format: int64
+ type: integer
+ - description: String in group parameters
+ in: query
+ name: string_group
+ schema:
+ type: integer
+ - description: Boolean in group parameters
+ in: header
+ name: boolean_group
+ schema:
+ type: boolean
+ - description: Integer in group parameters
+ in: query
+ name: int64_group
+ schema:
+ format: int64
+ type: integer
+ responses:
+ "400":
+ content: {}
+ description: Someting wrong
+ summary: Fake endpoint to test group parameters (optional)
+ tags:
+ - fake
+ x-group-parameters: true
+ x-accepts: application/json
+ get:
+ description: To test enum parameters
+ operationId: testEnumParameters
+ parameters:
+ - description: Header parameter enum test (string array)
+ explode: false
+ in: header
+ name: enum_header_string_array
+ schema:
+ items:
+ default: $
+ enum:
+ - '>'
+ - $
+ type: string
+ type: array
+ style: simple
+ - description: Header parameter enum test (string)
+ in: header
+ name: enum_header_string
+ schema:
+ default: -efg
+ enum:
+ - _abc
+ - -efg
+ - (xyz)
+ type: string
+ - description: Query parameter enum test (string array)
+ explode: false
+ in: query
+ name: enum_query_string_array
+ schema:
+ items:
+ default: $
+ enum:
+ - '>'
+ - $
+ type: string
+ type: array
+ style: form
+ - description: Query parameter enum test (string)
+ in: query
+ name: enum_query_string
+ schema:
+ default: -efg
+ enum:
+ - _abc
+ - -efg
+ - (xyz)
+ type: string
+ - description: Query parameter enum test (double)
+ in: query
+ name: enum_query_integer
+ schema:
+ enum:
+ - 1
+ - -2
+ format: int32
+ type: integer
+ - description: Query parameter enum test (double)
+ in: query
+ name: enum_query_double
+ schema:
+ enum:
+ - 1.1
+ - -1.2
+ format: double
+ type: number
+ requestBody:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ properties:
+ enum_form_string_array:
+ description: Form parameter enum test (string array)
+ items:
+ default: $
+ enum:
+ - '>'
+ - $
+ type: string
+ type: array
+ enum_form_string:
+ default: -efg
+ description: Form parameter enum test (string)
+ enum:
+ - _abc
+ - -efg
+ - (xyz)
+ type: string
+ responses:
+ "400":
+ content: {}
+ description: Invalid request
+ "404":
+ content: {}
+ description: Not found
+ summary: To test enum parameters
+ tags:
+ - fake
+ x-contentType: application/x-www-form-urlencoded
+ x-accepts: application/json
+ patch:
+ description: To test "client" model
+ operationId: testClientModel
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Client'
+ description: client model
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Client'
+ description: successful operation
+ summary: To test "client" model
+ tags:
+ - fake
+ x-codegen-request-body-name: body
+ x-contentType: application/json
+ x-accepts: application/json
+ post:
+ description: |-
+ Fake endpoint for testing various parameters
+ 假端點
+ 偽のエンドポイント
+ 가짜 엔드 포인트
+ operationId: testEndpointParameters
+ requestBody:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ properties:
+ integer:
+ description: None
+ format: int32
+ maximum: 100
+ minimum: 10
+ type: integer
+ int32:
+ description: None
+ format: int32
+ maximum: 200
+ minimum: 20
+ type: integer
+ int64:
+ description: None
+ format: int64
+ type: integer
+ number:
+ description: None
+ maximum: 543.2
+ minimum: 32.1
+ type: number
+ float:
+ description: None
+ format: float
+ maximum: 987.6
+ type: number
+ double:
+ description: None
+ format: double
+ maximum: 123.4
+ minimum: 67.8
+ type: number
+ string:
+ description: None
+ pattern: /[a-z]/i
+ type: string
+ pattern_without_delimiter:
+ description: None
+ pattern: ^[A-Z].*
+ type: string
+ byte:
+ description: None
+ format: byte
+ type: string
+ binary:
+ description: None
+ format: binary
+ type: string
+ date:
+ description: None
+ format: date
+ type: string
+ dateTime:
+ description: None
+ format: date-time
+ type: string
+ password:
+ description: None
+ format: password
+ maxLength: 64
+ minLength: 10
+ type: string
+ callback:
+ description: None
+ type: string
+ required:
+ - byte
+ - double
+ - number
+ - pattern_without_delimiter
+ required: true
+ responses:
+ "400":
+ content: {}
+ description: Invalid username supplied
+ "404":
+ content: {}
+ description: User not found
+ security:
+ - http_basic_test: []
+ summary: |-
+ Fake endpoint for testing various parameters
+ 假端點
+ 偽のエンドポイント
+ 가짜 엔드 포인트
+ tags:
+ - fake
+ x-contentType: application/x-www-form-urlencoded
+ x-accepts: application/json
+ /fake/outer/number:
+ post:
+ description: Test serialization of outer number types
+ operationId: fakeOuterNumberSerialize
+ requestBody:
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterNumber'
+ description: Input number as post body
+ required: false
+ responses:
+ "200":
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterNumber'
+ description: Output number
+ tags:
+ - fake
+ x-codegen-request-body-name: body
+ x-contentType: '*/*'
+ x-accepts: '*/*'
+ /fake/outer/string:
+ post:
+ description: Test serialization of outer string types
+ operationId: fakeOuterStringSerialize
+ requestBody:
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterString'
+ description: Input string as post body
+ required: false
+ responses:
+ "200":
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterString'
+ description: Output string
+ tags:
+ - fake
+ x-codegen-request-body-name: body
+ x-contentType: '*/*'
+ x-accepts: '*/*'
+ /fake/outer/boolean:
+ post:
+ description: Test serialization of outer boolean types
+ operationId: fakeOuterBooleanSerialize
+ requestBody:
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterBoolean'
+ description: Input boolean as post body
+ required: false
+ responses:
+ "200":
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterBoolean'
+ description: Output boolean
+ tags:
+ - fake
+ x-codegen-request-body-name: body
+ x-contentType: '*/*'
+ x-accepts: '*/*'
+ /fake/outer/composite:
+ post:
+ description: Test serialization of object with outer number type
+ operationId: fakeOuterCompositeSerialize
+ requestBody:
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterComposite'
+ description: Input composite as post body
+ required: false
+ responses:
+ "200":
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterComposite'
+ description: Output composite
+ tags:
+ - fake
+ x-codegen-request-body-name: body
+ x-contentType: '*/*'
+ x-accepts: '*/*'
+ /fake/jsonFormData:
+ get:
+ operationId: testJsonFormData
+ requestBody:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ properties:
+ param:
+ description: field1
+ type: string
+ param2:
+ description: field2
+ type: string
+ required:
+ - param
+ - param2
+ required: true
+ responses:
+ "200":
+ content: {}
+ description: successful operation
+ summary: test json serialization of form data
+ tags:
+ - fake
+ x-contentType: application/x-www-form-urlencoded
+ x-accepts: application/json
+ /fake/inline-additionalProperties:
+ post:
+ operationId: testInlineAdditionalProperties
+ requestBody:
+ content:
+ application/json:
+ schema:
+ additionalProperties:
+ type: string
+ type: object
+ description: request body
+ required: true
+ responses:
+ "200":
+ content: {}
+ description: successful operation
+ summary: test inline additionalProperties
+ tags:
+ - fake
+ x-codegen-request-body-name: param
+ x-contentType: application/json
+ x-accepts: application/json
+ /fake/body-with-query-params:
+ put:
+ operationId: testBodyWithQueryParams
+ parameters:
+ - in: query
+ name: query
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/User'
+ required: true
+ responses:
+ "200":
+ content: {}
+ description: Success
+ tags:
+ - fake
+ x-codegen-request-body-name: body
+ x-contentType: application/json
+ x-accepts: application/json
+ /fake/create_xml_item:
+ post:
+ description: this route creates an XmlItem
+ operationId: createXmlItem
+ requestBody:
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/XmlItem'
+ application/xml; charset=utf-8:
+ schema:
+ $ref: '#/components/schemas/XmlItem'
+ application/xml; charset=utf-16:
+ schema:
+ $ref: '#/components/schemas/XmlItem'
+ text/xml:
+ schema:
+ $ref: '#/components/schemas/XmlItem'
+ text/xml; charset=utf-8:
+ schema:
+ $ref: '#/components/schemas/XmlItem'
+ text/xml; charset=utf-16:
+ schema:
+ $ref: '#/components/schemas/XmlItem'
+ description: XmlItem Body
+ required: true
+ responses:
+ "200":
+ content: {}
+ description: successful operation
+ summary: creates an XmlItem
+ tags:
+ - fake
+ x-codegen-request-body-name: XmlItem
+ x-contentType: application/xml
+ x-accepts: application/json
+ /another-fake/dummy:
+ patch:
+ description: To test special tags and operation ID starting with number
+ operationId: 123_test_@#$%_special_tags
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Client'
+ description: client model
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Client'
+ description: successful operation
+ summary: To test special tags
+ tags:
+ - $another-fake?
+ x-codegen-request-body-name: body
+ x-contentType: application/json
+ x-accepts: application/json
+ /fake/body-with-file-schema:
+ put:
+ description: For this test, the body for this request much reference a schema
+ named `File`.
+ operationId: testBodyWithFileSchema
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/FileSchemaTestClass'
+ required: true
+ responses:
+ "200":
+ content: {}
+ description: Success
+ tags:
+ - fake
+ x-codegen-request-body-name: body
+ x-contentType: application/json
+ x-accepts: application/json
+ /fake/test-query-paramters:
+ put:
+ description: To test the collection format in query parameters
+ operationId: testQueryParameterCollectionFormat
+ parameters:
+ - explode: false
+ in: query
+ name: pipe
+ required: true
+ schema:
+ items:
+ type: string
+ type: array
+ style: form
+ - in: query
+ name: ioutil
+ required: true
+ schema:
+ items:
+ type: string
+ type: array
+ - in: query
+ name: http
+ required: true
+ schema:
+ items:
+ type: string
+ type: array
+ style: spaceDelimited
+ - explode: false
+ in: query
+ name: url
+ required: true
+ schema:
+ items:
+ type: string
+ type: array
+ style: form
+ - explode: true
+ in: query
+ name: context
+ required: true
+ schema:
+ items:
+ type: string
+ type: array
+ style: form
+ responses:
+ "200":
+ content: {}
+ description: Success
+ tags:
+ - fake
+ x-accepts: application/json
+ /fake/{petId}/uploadImageWithRequiredFile:
+ post:
+ operationId: uploadFileWithRequiredFile
+ parameters:
+ - description: ID of pet to update
+ in: path
+ name: petId
+ required: true
+ schema:
+ format: int64
+ type: integer
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ properties:
+ additionalMetadata:
+ description: Additional data to pass to server
+ type: string
+ requiredFile:
+ description: file to upload
+ format: binary
+ type: string
+ required:
+ - requiredFile
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiResponse'
+ description: successful operation
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: uploads an image (required)
+ tags:
+ - pet
+ x-contentType: multipart/form-data
+ x-accepts: application/json
+components:
+ schemas:
+ Order:
+ example:
+ petId: 6
+ quantity: 1
+ id: 0
+ shipDate: 2000-01-23T04:56:07.000+00:00
+ complete: false
+ status: placed
+ properties:
+ id:
+ format: int64
+ type: integer
+ petId:
+ format: int64
+ type: integer
+ quantity:
+ format: int32
+ type: integer
+ shipDate:
+ format: date-time
+ type: string
+ status:
+ description: Order Status
+ enum:
+ - placed
+ - approved
+ - delivered
+ type: string
+ complete:
+ default: false
+ type: boolean
+ type: object
+ xml:
+ name: Order
+ Category:
+ example:
+ name: default-name
+ id: 6
+ properties:
+ id:
+ format: int64
+ type: integer
+ name:
+ default: default-name
+ type: string
+ required:
+ - name
+ type: object
+ xml:
+ name: Category
+ User:
+ example:
+ firstName: firstName
+ lastName: lastName
+ password: password
+ userStatus: 6
+ phone: phone
+ id: 0
+ email: email
+ username: username
+ properties:
+ id:
+ format: int64
+ type: integer
+ x-is-unique: true
+ username:
+ type: string
+ firstName:
+ type: string
+ lastName:
+ type: string
+ email:
+ type: string
+ password:
+ type: string
+ phone:
+ type: string
+ userStatus:
+ description: User Status
+ format: int32
+ type: integer
+ type: object
+ xml:
+ name: User
+ Tag:
+ example:
+ name: name
+ id: 1
+ properties:
+ id:
+ format: int64
+ type: integer
+ name:
+ type: string
+ type: object
+ xml:
+ name: Tag
+ Pet:
+ example:
+ photoUrls:
+ - photoUrls
+ - photoUrls
+ name: doggie
+ id: 0
+ category:
+ name: default-name
+ id: 6
+ tags:
+ - name: name
+ id: 1
+ - name: name
+ id: 1
+ status: available
+ properties:
+ id:
+ format: int64
+ type: integer
+ x-is-unique: true
+ category:
+ $ref: '#/components/schemas/Category'
+ name:
+ example: doggie
+ type: string
+ photoUrls:
+ items:
+ type: string
+ type: array
+ uniqueItems: true
+ xml:
+ name: photoUrl
+ wrapped: true
+ tags:
+ items:
+ $ref: '#/components/schemas/Tag'
+ type: array
+ xml:
+ name: tag
+ wrapped: true
+ status:
+ description: pet status in the store
+ enum:
+ - available
+ - pending
+ - sold
+ type: string
+ required:
+ - name
+ - photoUrls
+ type: object
+ xml:
+ name: Pet
+ ApiResponse:
+ example:
+ code: 0
+ type: type
+ message: message
+ properties:
+ code:
+ format: int32
+ type: integer
+ type:
+ type: string
+ message:
+ type: string
+ type: object
+ $special[model.name]:
+ properties:
+ $special[property.name]:
+ format: int64
+ type: integer
+ type: object
+ xml:
+ name: $special[model.name]
+ Return:
+ description: Model for testing reserved words
+ properties:
+ return:
+ format: int32
+ type: integer
+ type: object
+ xml:
+ name: Return
+ Name:
+ description: Model for testing model name same as property name
+ properties:
+ name:
+ format: int32
+ type: integer
+ snake_case:
+ format: int32
+ readOnly: true
+ type: integer
+ property:
+ type: string
+ "123Number":
+ readOnly: true
+ type: integer
+ required:
+ - name
+ type: object
+ xml:
+ name: Name
+ "200_response":
+ description: Model for testing model name starting with number
+ properties:
+ name:
+ format: int32
+ type: integer
+ class:
+ type: string
+ type: object
+ xml:
+ name: Name
+ ClassModel:
+ description: Model for testing model with "_class" property
+ properties:
+ _class:
+ type: string
+ type: object
+ Dog:
+ allOf:
+ - $ref: '#/components/schemas/Animal'
+ - $ref: '#/components/schemas/Dog_allOf'
+ Cat:
+ allOf:
+ - $ref: '#/components/schemas/Animal'
+ - $ref: '#/components/schemas/Cat_allOf'
+ BigCat:
+ allOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/BigCat_allOf'
+ Animal:
+ discriminator:
+ propertyName: className
+ properties:
+ className:
+ type: string
+ color:
+ default: red
+ type: string
+ required:
+ - className
+ type: object
+ AnimalFarm:
+ items:
+ $ref: '#/components/schemas/Animal'
+ type: array
+ format_test:
+ properties:
+ integer:
+ maximum: 1E+2
+ minimum: 1E+1
+ type: integer
+ int32:
+ format: int32
+ maximum: 2E+2
+ minimum: 2E+1
+ type: integer
+ int64:
+ format: int64
+ type: integer
+ number:
+ maximum: 543.2
+ minimum: 32.1
+ type: number
+ float:
+ format: float
+ maximum: 987.6
+ minimum: 54.3
+ type: number
+ double:
+ format: double
+ maximum: 123.4
+ minimum: 67.8
+ type: number
+ string:
+ pattern: /[a-z]/i
+ type: string
+ byte:
+ format: byte
+ pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
+ type: string
+ binary:
+ format: binary
+ type: string
+ date:
+ format: date
+ type: string
+ dateTime:
+ format: date-time
+ type: string
+ uuid:
+ example: 72f98069-206d-4f12-9f12-3d1e525a8e84
+ format: uuid
+ type: string
+ password:
+ format: password
+ maxLength: 64
+ minLength: 10
+ type: string
+ BigDecimal:
+ format: number
+ type: string
+ required:
+ - byte
+ - date
+ - number
+ - password
+ type: object
+ EnumClass:
+ default: -efg
+ enum:
+ - _abc
+ - -efg
+ - (xyz)
+ type: string
+ Enum_Test:
+ properties:
+ enum_string:
+ enum:
+ - UPPER
+ - lower
+ - ""
+ type: string
+ enum_string_required:
+ enum:
+ - UPPER
+ - lower
+ - ""
+ type: string
+ enum_integer:
+ enum:
+ - 1
+ - -1
+ format: int32
+ type: integer
+ enum_number:
+ enum:
+ - 1.1
+ - -1.2
+ format: double
+ type: number
+ outerEnum:
+ $ref: '#/components/schemas/OuterEnum'
+ required:
+ - enum_string_required
+ type: object
+ AdditionalPropertiesClass:
+ properties:
+ map_string:
+ additionalProperties:
+ type: string
+ type: object
+ map_number:
+ additionalProperties:
+ type: number
+ type: object
+ map_integer:
+ additionalProperties:
+ type: integer
+ type: object
+ map_boolean:
+ additionalProperties:
+ type: boolean
+ type: object
+ map_array_integer:
+ additionalProperties:
+ items:
+ type: integer
+ type: array
+ type: object
+ map_array_anytype:
+ additionalProperties:
+ items:
+ properties: {}
+ type: object
+ type: array
+ type: object
+ map_map_string:
+ additionalProperties:
+ additionalProperties:
+ type: string
+ type: object
+ type: object
+ map_map_anytype:
+ additionalProperties:
+ additionalProperties:
+ properties: {}
+ type: object
+ type: object
+ type: object
+ anytype_1:
+ properties: {}
+ type: object
+ anytype_2:
+ type: object
+ anytype_3:
+ properties: {}
+ type: object
+ type: object
+ AdditionalPropertiesString:
+ additionalProperties:
+ type: string
+ properties:
+ name:
+ type: string
+ type: object
+ AdditionalPropertiesInteger:
+ additionalProperties:
+ type: integer
+ properties:
+ name:
+ type: string
+ type: object
+ AdditionalPropertiesNumber:
+ additionalProperties:
+ type: number
+ properties:
+ name:
+ type: string
+ type: object
+ AdditionalPropertiesBoolean:
+ additionalProperties:
+ type: boolean
+ properties:
+ name:
+ type: string
+ type: object
+ AdditionalPropertiesArray:
+ additionalProperties:
+ items:
+ properties: {}
+ type: object
+ type: array
+ properties:
+ name:
+ type: string
+ type: object
+ AdditionalPropertiesObject:
+ additionalProperties:
+ additionalProperties:
+ properties: {}
+ type: object
+ type: object
+ properties:
+ name:
+ type: string
+ type: object
+ AdditionalPropertiesAnyType:
+ additionalProperties:
+ properties: {}
+ type: object
+ properties:
+ name:
+ type: string
+ type: object
+ MixedPropertiesAndAdditionalPropertiesClass:
+ properties:
+ uuid:
+ format: uuid
+ type: string
+ dateTime:
+ format: date-time
+ type: string
+ map:
+ additionalProperties:
+ $ref: '#/components/schemas/Animal'
+ type: object
+ type: object
+ List:
+ properties:
+ "123-list":
+ type: string
+ type: object
+ Client:
+ example:
+ client: client
+ properties:
+ client:
+ type: string
+ type: object
+ ReadOnlyFirst:
+ properties:
+ bar:
+ readOnly: true
+ type: string
+ baz:
+ type: string
+ type: object
+ hasOnlyReadOnly:
+ properties:
+ bar:
+ readOnly: true
+ type: string
+ foo:
+ readOnly: true
+ type: string
+ type: object
+ Capitalization:
+ properties:
+ smallCamel:
+ type: string
+ CapitalCamel:
+ type: string
+ small_Snake:
+ type: string
+ Capital_Snake:
+ type: string
+ SCA_ETH_Flow_Points:
+ type: string
+ ATT_NAME:
+ description: |
+ Name of the pet
+ type: string
+ type: object
+ MapTest:
+ properties:
+ map_map_of_string:
+ additionalProperties:
+ additionalProperties:
+ type: string
+ type: object
+ type: object
+ map_of_enum_string:
+ additionalProperties:
+ enum:
+ - UPPER
+ - lower
+ type: string
+ type: object
+ direct_map:
+ additionalProperties:
+ type: boolean
+ type: object
+ indirect_map:
+ additionalProperties:
+ type: boolean
+ type: object
+ type: object
+ ArrayTest:
+ properties:
+ array_of_string:
+ items:
+ type: string
+ type: array
+ array_array_of_integer:
+ items:
+ items:
+ format: int64
+ type: integer
+ type: array
+ type: array
+ array_array_of_model:
+ items:
+ items:
+ $ref: '#/components/schemas/ReadOnlyFirst'
+ type: array
+ type: array
+ type: object
+ NumberOnly:
+ properties:
+ JustNumber:
+ type: number
+ type: object
+ ArrayOfNumberOnly:
+ properties:
+ ArrayNumber:
+ items:
+ type: number
+ type: array
+ type: object
+ ArrayOfArrayOfNumberOnly:
+ properties:
+ ArrayArrayNumber:
+ items:
+ items:
+ type: number
+ type: array
+ type: array
+ type: object
+ EnumArrays:
+ properties:
+ just_symbol:
+ enum:
+ - '>='
+ - $
+ type: string
+ array_enum:
+ items:
+ enum:
+ - fish
+ - crab
+ type: string
+ type: array
+ type: object
+ OuterEnum:
+ enum:
+ - placed
+ - approved
+ - delivered
+ type: string
+ OuterComposite:
+ example:
+ my_string: my_string
+ my_number: 0.8008281904610115
+ my_boolean: true
+ properties:
+ my_number:
+ type: number
+ my_string:
+ type: string
+ my_boolean:
+ type: boolean
+ x-codegen-body-parameter-name: boolean_post_body
+ type: object
+ OuterNumber:
+ type: number
+ OuterString:
+ type: string
+ OuterBoolean:
+ type: boolean
+ x-codegen-body-parameter-name: boolean_post_body
+ StringBooleanMap:
+ additionalProperties:
+ type: boolean
+ type: object
+ FileSchemaTestClass:
+ example:
+ file:
+ sourceURI: sourceURI
+ files:
+ - sourceURI: sourceURI
+ - sourceURI: sourceURI
+ properties:
+ file:
+ $ref: '#/components/schemas/File'
+ files:
+ items:
+ $ref: '#/components/schemas/File'
+ type: array
+ type: object
+ File:
+ description: Must be named `File` for test.
+ example:
+ sourceURI: sourceURI
+ properties:
+ sourceURI:
+ description: Test capitalization
+ type: string
+ type: object
+ TypeHolderDefault:
+ properties:
+ string_item:
+ default: what
+ type: string
+ number_item:
+ type: number
+ integer_item:
+ type: integer
+ bool_item:
+ default: true
+ type: boolean
+ array_item:
+ items:
+ type: integer
+ type: array
+ required:
+ - array_item
+ - bool_item
+ - integer_item
+ - number_item
+ - string_item
+ type: object
+ TypeHolderExample:
+ properties:
+ string_item:
+ example: what
+ type: string
+ number_item:
+ example: 1.234
+ type: number
+ float_item:
+ example: 1.234
+ format: float
+ type: number
+ integer_item:
+ example: -2
+ type: integer
+ bool_item:
+ example: true
+ type: boolean
+ array_item:
+ example:
+ - 0
+ - 1
+ - 2
+ - 3
+ items:
+ type: integer
+ type: array
+ required:
+ - array_item
+ - bool_item
+ - float_item
+ - integer_item
+ - number_item
+ - string_item
+ type: object
+ XmlItem:
+ properties:
+ attribute_string:
+ example: string
+ type: string
+ xml:
+ attribute: true
+ attribute_number:
+ example: 1.234
+ type: number
+ xml:
+ attribute: true
+ attribute_integer:
+ example: -2
+ type: integer
+ xml:
+ attribute: true
+ attribute_boolean:
+ example: true
+ type: boolean
+ xml:
+ attribute: true
+ wrapped_array:
+ items:
+ type: integer
+ type: array
+ xml:
+ wrapped: true
+ name_string:
+ example: string
+ type: string
+ xml:
+ name: xml_name_string
+ name_number:
+ example: 1.234
+ type: number
+ xml:
+ name: xml_name_number
+ name_integer:
+ example: -2
+ type: integer
+ xml:
+ name: xml_name_integer
+ name_boolean:
+ example: true
+ type: boolean
+ xml:
+ name: xml_name_boolean
+ name_array:
+ items:
+ type: integer
+ xml:
+ name: xml_name_array_item
+ type: array
+ name_wrapped_array:
+ items:
+ type: integer
+ xml:
+ name: xml_name_wrapped_array_item
+ type: array
+ xml:
+ name: xml_name_wrapped_array
+ wrapped: true
+ prefix_string:
+ example: string
+ type: string
+ xml:
+ prefix: ab
+ prefix_number:
+ example: 1.234
+ type: number
+ xml:
+ prefix: cd
+ prefix_integer:
+ example: -2
+ type: integer
+ xml:
+ prefix: ef
+ prefix_boolean:
+ example: true
+ type: boolean
+ xml:
+ prefix: gh
+ prefix_array:
+ items:
+ type: integer
+ xml:
+ prefix: ij
+ type: array
+ prefix_wrapped_array:
+ items:
+ type: integer
+ xml:
+ prefix: mn
+ type: array
+ xml:
+ prefix: kl
+ wrapped: true
+ namespace_string:
+ example: string
+ type: string
+ xml:
+ namespace: http://a.com/schema
+ namespace_number:
+ example: 1.234
+ type: number
+ xml:
+ namespace: http://b.com/schema
+ namespace_integer:
+ example: -2
+ type: integer
+ xml:
+ namespace: http://c.com/schema
+ namespace_boolean:
+ example: true
+ type: boolean
+ xml:
+ namespace: http://d.com/schema
+ namespace_array:
+ items:
+ type: integer
+ xml:
+ namespace: http://e.com/schema
+ type: array
+ namespace_wrapped_array:
+ items:
+ type: integer
+ xml:
+ namespace: http://g.com/schema
+ type: array
+ xml:
+ namespace: http://f.com/schema
+ wrapped: true
+ prefix_ns_string:
+ example: string
+ type: string
+ xml:
+ namespace: http://a.com/schema
+ prefix: a
+ prefix_ns_number:
+ example: 1.234
+ type: number
+ xml:
+ namespace: http://b.com/schema
+ prefix: b
+ prefix_ns_integer:
+ example: -2
+ type: integer
+ xml:
+ namespace: http://c.com/schema
+ prefix: c
+ prefix_ns_boolean:
+ example: true
+ type: boolean
+ xml:
+ namespace: http://d.com/schema
+ prefix: d
+ prefix_ns_array:
+ items:
+ type: integer
+ xml:
+ namespace: http://e.com/schema
+ prefix: e
+ type: array
+ prefix_ns_wrapped_array:
+ items:
+ type: integer
+ xml:
+ namespace: http://g.com/schema
+ prefix: g
+ type: array
+ xml:
+ namespace: http://f.com/schema
+ prefix: f
+ wrapped: true
+ type: object
+ xml:
+ namespace: http://a.com/schema
+ prefix: pre
+ Dog_allOf:
+ properties:
+ breed:
+ type: string
+ type: object
+ Cat_allOf:
+ properties:
+ declawed:
+ type: boolean
+ type: object
+ BigCat_allOf:
+ properties:
+ kind:
+ enum:
+ - lions
+ - tigers
+ - leopards
+ - jaguars
+ type: string
+ type: object
+ securitySchemes:
+ petstore_auth:
+ flows:
+ implicit:
+ authorizationUrl: http://petstore.swagger.io/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+ type: oauth2
+ api_key:
+ in: header
+ name: api_key
+ type: apiKey
+ api_key_query:
+ in: query
+ name: api_key_query
+ type: apiKey
+ http_basic_test:
+ scheme: basic
+ type: http
+x-original-swagger-version: "2.0"
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle b/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle
new file mode 100644
index 000000000000..3dd4820446aa
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle
@@ -0,0 +1,126 @@
+apply plugin: 'idea'
+apply plugin: 'eclipse'
+
+group = 'org.openapitools'
+version = '1.0.0'
+
+buildscript {
+ repositories {
+ maven { url "https://repo1.maven.org/maven2" }
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:2.3.+'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
+ }
+}
+
+repositories {
+ jcenter()
+}
+
+
+if(hasProperty('target') && target == 'android') {
+
+ apply plugin: 'com.android.library'
+ apply plugin: 'com.github.dcendents.android-maven'
+
+ android {
+ compileSdkVersion 25
+ buildToolsVersion '25.0.2'
+ defaultConfig {
+ minSdkVersion 14
+ targetSdkVersion 25
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+ // Rename the aar correctly
+ libraryVariants.all { variant ->
+ variant.outputs.each { output ->
+ def outputFile = output.outputFile
+ if (outputFile != null && outputFile.name.endsWith('.aar')) {
+ def fileName = "${project.name}-${variant.baseName}-${version}.aar"
+ output.outputFile = new File(outputFile.parent, fileName)
+ }
+ }
+ }
+
+ dependencies {
+ provided 'javax.annotation:jsr250-api:1.0'
+ }
+ }
+
+ afterEvaluate {
+ android.libraryVariants.all { variant ->
+ def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
+ task.description = "Create jar artifact for ${variant.name}"
+ task.dependsOn variant.javaCompile
+ task.from variant.javaCompile.destinationDir
+ task.destinationDir = project.file("${project.buildDir}/outputs/jar")
+ task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
+ artifacts.add('archives', task);
+ }
+ }
+
+ task sourcesJar(type: Jar) {
+ from android.sourceSets.main.java.srcDirs
+ classifier = 'sources'
+ }
+
+ artifacts {
+ archives sourcesJar
+ }
+
+} else {
+
+ apply plugin: 'java'
+ apply plugin: 'maven'
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+
+ install {
+ repositories.mavenInstaller {
+ pom.artifactId = 'petstore-jersey2-java8-localdatetime'
+ }
+ }
+
+ task execute(type:JavaExec) {
+ main = System.getProperty('mainClass')
+ classpath = sourceSets.main.runtimeClasspath
+ }
+}
+
+ext {
+ swagger_annotations_version = "1.5.22"
+ jackson_version = "2.10.3"
+ jackson_databind_version = "2.10.4"
+ jackson_databind_nullable_version = "0.2.1"
+ jersey_version = "2.27"
+ junit_version = "4.13.1"
+ scribejava_apis_version = "6.9.0"
+}
+
+dependencies {
+ implementation "io.swagger:swagger-annotations:$swagger_annotations_version"
+ implementation "com.google.code.findbugs:jsr305:3.0.2"
+ implementation "org.glassfish.jersey.core:jersey-client:$jersey_version"
+ implementation "org.glassfish.jersey.inject:jersey-hk2:$jersey_version"
+ implementation "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version"
+ implementation "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version"
+ implementation "org.glassfish.jersey.connectors:jersey-apache-connector:$jersey_version"
+ implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version"
+ implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
+ implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
+ implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
+ implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
+ implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version"
+ implementation 'javax.annotation:javax.annotation-api:1.3.2'
+ testImplementation "junit:junit:$junit_version"
+}
+
+javadoc {
+ options.tags = [ "http.response.details:a:Http Response Details" ]
+}
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt b/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt
new file mode 100644
index 000000000000..6769e84734de
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt
@@ -0,0 +1,27 @@
+lazy val root = (project in file(".")).
+ settings(
+ organization := "org.openapitools",
+ name := "petstore-jersey2-java8-localdatetime",
+ version := "1.0.0",
+ scalaVersion := "2.11.4",
+ scalacOptions ++= Seq("-feature"),
+ javacOptions in compile ++= Seq("-Xlint:deprecation"),
+ publishArtifact in (Compile, packageDoc) := false,
+ resolvers += Resolver.mavenLocal,
+ libraryDependencies ++= Seq(
+ "io.swagger" % "swagger-annotations" % "1.5.22",
+ "org.glassfish.jersey.core" % "jersey-client" % "2.27",
+ "org.glassfish.jersey.inject" % "jersey-hk2" % "2.27",
+ "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.27",
+ "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.27",
+ "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.27",
+ "com.fasterxml.jackson.core" % "jackson-core" % "2.10.4" % "compile",
+ "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.4" % "compile",
+ "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile",
+ "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile",
+ "com.github.scribejava" % "scribejava-apis" % "6.9.0" % "compile",
+ "javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
+ "junit" % "junit" % "4.13.1" % "test",
+ "com.novocode" % "junit-interface" % "0.10" % "test"
+ )
+ )
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesAnyType.md
new file mode 100644
index 000000000000..87b468bb7ca3
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesAnyType.md
@@ -0,0 +1,12 @@
+
+
+# AdditionalPropertiesAnyType
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesArray.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesArray.md
new file mode 100644
index 000000000000..cb7fe9b3903d
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesArray.md
@@ -0,0 +1,12 @@
+
+
+# AdditionalPropertiesArray
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesBoolean.md
new file mode 100644
index 000000000000..6b53e7ba73a1
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesBoolean.md
@@ -0,0 +1,12 @@
+
+
+# AdditionalPropertiesBoolean
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesClass.md
new file mode 100644
index 000000000000..f9e189355cfd
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesClass.md
@@ -0,0 +1,22 @@
+
+
+# AdditionalPropertiesClass
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mapString** | **Map<String, String>** | | [optional]
+**mapNumber** | **Map<String, BigDecimal>** | | [optional]
+**mapInteger** | **Map<String, Integer>** | | [optional]
+**mapBoolean** | **Map<String, Boolean>** | | [optional]
+**mapArrayInteger** | **Map<String, List<Integer>>** | | [optional]
+**mapArrayAnytype** | **Map<String, List<Object>>** | | [optional]
+**mapMapString** | **Map<String, Map<String, String>>** | | [optional]
+**mapMapAnytype** | **Map<String, Map<String, Object>>** | | [optional]
+**anytype1** | **Object** | | [optional]
+**anytype2** | **Object** | | [optional]
+**anytype3** | **Object** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesInteger.md
new file mode 100644
index 000000000000..d2ed7fb1a460
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesInteger.md
@@ -0,0 +1,12 @@
+
+
+# AdditionalPropertiesInteger
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesNumber.md
new file mode 100644
index 000000000000..53f6e81e7176
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesNumber.md
@@ -0,0 +1,12 @@
+
+
+# AdditionalPropertiesNumber
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesObject.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesObject.md
new file mode 100644
index 000000000000..98ac8d2e5fe0
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesObject.md
@@ -0,0 +1,12 @@
+
+
+# AdditionalPropertiesObject
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesString.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesString.md
new file mode 100644
index 000000000000..d7970cdfe190
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AdditionalPropertiesString.md
@@ -0,0 +1,12 @@
+
+
+# AdditionalPropertiesString
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Animal.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Animal.md
new file mode 100644
index 000000000000..c8e18ae55e4f
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Animal.md
@@ -0,0 +1,13 @@
+
+
+# Animal
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**className** | **String** | |
+**color** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AnotherFakeApi.md
new file mode 100644
index 000000000000..1634ef64dbbb
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/AnotherFakeApi.md
@@ -0,0 +1,74 @@
+# AnotherFakeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
+
+
+
+## call123testSpecialTags
+
+> Client call123testSpecialTags(body)
+
+To test special tags
+
+To test special tags and operation ID starting with number
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.AnotherFakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient);
+ Client body = new Client(); // Client | client model
+ try {
+ Client result = apiInstance.call123testSpecialTags(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Client**](Client.md)| client model |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ArrayOfArrayOfNumberOnly.md
new file mode 100644
index 000000000000..e1a0e54c0b57
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ArrayOfArrayOfNumberOnly.md
@@ -0,0 +1,12 @@
+
+
+# ArrayOfArrayOfNumberOnly
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayArrayNumber** | **List<List<BigDecimal>>** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ArrayOfNumberOnly.md
new file mode 100644
index 000000000000..25670a603c47
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ArrayOfNumberOnly.md
@@ -0,0 +1,12 @@
+
+
+# ArrayOfNumberOnly
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayNumber** | **List<BigDecimal>** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ArrayTest.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ArrayTest.md
new file mode 100644
index 000000000000..7c6f6245ac8a
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ArrayTest.md
@@ -0,0 +1,14 @@
+
+
+# ArrayTest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayOfString** | **List<String>** | | [optional]
+**arrayArrayOfInteger** | **List<List<Long>>** | | [optional]
+**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/BigCat.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/BigCat.md
new file mode 100644
index 000000000000..8a075304abf8
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/BigCat.md
@@ -0,0 +1,23 @@
+
+
+# BigCat
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**kind** | [**KindEnum**](#KindEnum) | | [optional]
+
+
+
+## Enum: KindEnum
+
+Name | Value
+---- | -----
+LIONS | "lions"
+TIGERS | "tigers"
+LEOPARDS | "leopards"
+JAGUARS | "jaguars"
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/BigCatAllOf.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/BigCatAllOf.md
new file mode 100644
index 000000000000..21177dbf089d
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/BigCatAllOf.md
@@ -0,0 +1,23 @@
+
+
+# BigCatAllOf
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**kind** | [**KindEnum**](#KindEnum) | | [optional]
+
+
+
+## Enum: KindEnum
+
+Name | Value
+---- | -----
+LIONS | "lions"
+TIGERS | "tigers"
+LEOPARDS | "leopards"
+JAGUARS | "jaguars"
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Capitalization.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Capitalization.md
new file mode 100644
index 000000000000..7b73c40b5545
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Capitalization.md
@@ -0,0 +1,17 @@
+
+
+# Capitalization
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**smallCamel** | **String** | | [optional]
+**capitalCamel** | **String** | | [optional]
+**smallSnake** | **String** | | [optional]
+**capitalSnake** | **String** | | [optional]
+**scAETHFlowPoints** | **String** | | [optional]
+**ATT_NAME** | **String** | Name of the pet | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Cat.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Cat.md
new file mode 100644
index 000000000000..39c2f864df88
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Cat.md
@@ -0,0 +1,12 @@
+
+
+# Cat
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**declawed** | **Boolean** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/CatAllOf.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/CatAllOf.md
new file mode 100644
index 000000000000..1098fd900c5d
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/CatAllOf.md
@@ -0,0 +1,12 @@
+
+
+# CatAllOf
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**declawed** | **Boolean** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Category.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Category.md
new file mode 100644
index 000000000000..613ea9f7ee24
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Category.md
@@ -0,0 +1,13 @@
+
+
+# Category
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**name** | **String** | |
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ClassModel.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ClassModel.md
new file mode 100644
index 000000000000..d5453c20133a
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ClassModel.md
@@ -0,0 +1,13 @@
+
+
+# ClassModel
+
+Model for testing model with \"_class\" property
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**propertyClass** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Client.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Client.md
new file mode 100644
index 000000000000..228df492383f
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Client.md
@@ -0,0 +1,12 @@
+
+
+# Client
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**client** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Dog.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Dog.md
new file mode 100644
index 000000000000..73cedf2bc919
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Dog.md
@@ -0,0 +1,12 @@
+
+
+# Dog
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**breed** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/DogAllOf.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/DogAllOf.md
new file mode 100644
index 000000000000..cbeb9e9a22df
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/DogAllOf.md
@@ -0,0 +1,12 @@
+
+
+# DogAllOf
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**breed** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/EnumArrays.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/EnumArrays.md
new file mode 100644
index 000000000000..869b7a6c066d
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/EnumArrays.md
@@ -0,0 +1,31 @@
+
+
+# EnumArrays
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional]
+**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional]
+
+
+
+## Enum: JustSymbolEnum
+
+Name | Value
+---- | -----
+GREATER_THAN_OR_EQUAL_TO | ">="
+DOLLAR | "$"
+
+
+
+## Enum: List<ArrayEnumEnum>
+
+Name | Value
+---- | -----
+FISH | "fish"
+CRAB | "crab"
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/EnumClass.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/EnumClass.md
new file mode 100644
index 000000000000..b314590a7591
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/EnumClass.md
@@ -0,0 +1,15 @@
+
+
+# EnumClass
+
+## Enum
+
+
+* `_ABC` (value: `"_abc"`)
+
+* `_EFG` (value: `"-efg"`)
+
+* `_XYZ_` (value: `"(xyz)"`)
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/EnumTest.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/EnumTest.md
new file mode 100644
index 000000000000..e066d77e5b07
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/EnumTest.md
@@ -0,0 +1,54 @@
+
+
+# EnumTest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
+**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | |
+**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional]
+**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional]
+**outerEnum** | **OuterEnum** | | [optional]
+
+
+
+## Enum: EnumStringEnum
+
+Name | Value
+---- | -----
+UPPER | "UPPER"
+LOWER | "lower"
+EMPTY | ""
+
+
+
+## Enum: EnumStringRequiredEnum
+
+Name | Value
+---- | -----
+UPPER | "UPPER"
+LOWER | "lower"
+EMPTY | ""
+
+
+
+## Enum: EnumIntegerEnum
+
+Name | Value
+---- | -----
+NUMBER_1 | 1
+NUMBER_MINUS_1 | -1
+
+
+
+## Enum: EnumNumberEnum
+
+Name | Value
+---- | -----
+NUMBER_1_DOT_1 | 1.1
+NUMBER_MINUS_1_DOT_2 | -1.2
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/FakeApi.md
new file mode 100644
index 000000000000..e84c1e7b2854
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/FakeApi.md
@@ -0,0 +1,1002 @@
+# FakeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**createXmlItem**](FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem
+[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
+[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
+[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
+[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
+[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
+[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
+[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
+[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
+[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
+[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
+[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
+[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters |
+
+
+
+## createXmlItem
+
+> createXmlItem(xmlItem)
+
+creates an XmlItem
+
+this route creates an XmlItem
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ XmlItem xmlItem = new XmlItem(); // XmlItem | XmlItem Body
+ try {
+ apiInstance.createXmlItem(xmlItem);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#createXmlItem");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **xmlItem** | [**XmlItem**](XmlItem.md)| XmlItem Body |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
+
+## fakeOuterBooleanSerialize
+
+> Boolean fakeOuterBooleanSerialize(body)
+
+
+
+Test serialization of outer boolean types
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ Boolean body = true; // Boolean | Input boolean as post body
+ try {
+ Boolean result = apiInstance.fakeOuterBooleanSerialize(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **Boolean**| Input boolean as post body | [optional]
+
+### Return type
+
+**Boolean**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Output boolean | - |
+
+
+## fakeOuterCompositeSerialize
+
+> OuterComposite fakeOuterCompositeSerialize(body)
+
+
+
+Test serialization of object with outer number type
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body
+ try {
+ OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
+
+### Return type
+
+[**OuterComposite**](OuterComposite.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Output composite | - |
+
+
+## fakeOuterNumberSerialize
+
+> BigDecimal fakeOuterNumberSerialize(body)
+
+
+
+Test serialization of outer number types
+
+### Example
+
+```java
+import java.math.BigDecimal;
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
+ try {
+ BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **BigDecimal**| Input number as post body | [optional]
+
+### Return type
+
+[**BigDecimal**](BigDecimal.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Output number | - |
+
+
+## fakeOuterStringSerialize
+
+> String fakeOuterStringSerialize(body)
+
+
+
+Test serialization of outer string types
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ String body = "body_example"; // String | Input string as post body
+ try {
+ String result = apiInstance.fakeOuterStringSerialize(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **String**| Input string as post body | [optional]
+
+### Return type
+
+**String**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Output string | - |
+
+
+## testBodyWithFileSchema
+
+> testBodyWithFileSchema(body)
+
+
+
+For this test, the body for this request much reference a schema named `File`.
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ FileSchemaTestClass body = new FileSchemaTestClass(); // FileSchemaTestClass |
+ try {
+ apiInstance.testBodyWithFileSchema(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Success | - |
+
+
+## testBodyWithQueryParams
+
+> testBodyWithQueryParams(query, body)
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ String query = "query_example"; // String |
+ User body = new User(); // User |
+ try {
+ apiInstance.testBodyWithQueryParams(query, body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testBodyWithQueryParams");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **query** | **String**| |
+ **body** | [**User**](User.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Success | - |
+
+
+## testClientModel
+
+> Client testClientModel(body)
+
+To test \"client\" model
+
+To test "client" model
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ Client body = new Client(); // Client | client model
+ try {
+ Client result = apiInstance.testClientModel(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testClientModel");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Client**](Client.md)| client model |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
+
+## testEndpointParameters
+
+> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback)
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+Fake endpoint for testing various parameters
+ 假端點
+ 偽のエンドポイント
+ 가짜 엔드 포인트
+
+### Example
+
+```java
+import java.io.File;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure HTTP basic authorization: http_basic_test
+ HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test");
+ http_basic_test.setUsername("YOUR USERNAME");
+ http_basic_test.setPassword("YOUR PASSWORD");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ BigDecimal number = new BigDecimal(78); // 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
+ LocalDateTime dateTime = new LocalDateTime(); // LocalDateTime | None
+ String password = "password_example"; // String | None
+ String paramCallback = "paramCallback_example"; // String | None
+ try {
+ apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testEndpointParameters");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **number** | **BigDecimal**| None |
+ **_double** | **Double**| None |
+ **patternWithoutDelimiter** | **String**| None |
+ **_byte** | **byte[]**| None |
+ **integer** | **Integer**| None | [optional]
+ **int32** | **Integer**| None | [optional]
+ **int64** | **Long**| None | [optional]
+ **_float** | **Float**| None | [optional]
+ **string** | **String**| None | [optional]
+ **binary** | **File**| None | [optional]
+ **date** | **LocalDate**| None | [optional]
+ **dateTime** | **LocalDateTime**| None | [optional]
+ **password** | **String**| None | [optional]
+ **paramCallback** | **String**| None | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[http_basic_test](../README.md#http_basic_test)
+
+### HTTP request headers
+
+- **Content-Type**: application/x-www-form-urlencoded
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid username supplied | - |
+| **404** | User not found | - |
+
+
+## testEnumParameters
+
+> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString)
+
+To test enum parameters
+
+To test enum parameters
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array)
+ String enumHeaderString = "-efg"; // String | Header parameter enum test (string)
+ List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array)
+ String enumQueryString = "-efg"; // String | Query parameter enum test (string)
+ Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double)
+ Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double)
+ List enumFormStringArray = "$"; // List | Form parameter enum test (string array)
+ String enumFormString = "-efg"; // String | Form parameter enum test (string)
+ try {
+ apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testEnumParameters");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **enumHeaderStringArray** | **List<String>**| Header parameter enum test (string array) | [optional] [enum: >, $]
+ **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
+ **enumQueryStringArray** | **List<String>**| Query parameter enum test (string array) | [optional] [enum: >, $]
+ **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
+ **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2]
+ **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2]
+ **enumFormStringArray** | **List<String>**| Form parameter enum test (string array) | [optional] [enum: >, $]
+ **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/x-www-form-urlencoded
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid request | - |
+| **404** | Not found | - |
+
+
+## testGroupParameters
+
+> testGroupParameters().requiredStringGroup(requiredStringGroup).requiredBooleanGroup(requiredBooleanGroup).requiredInt64Group(requiredInt64Group).stringGroup(stringGroup).booleanGroup(booleanGroup).int64Group(int64Group).execute();
+
+Fake endpoint to test group parameters (optional)
+
+Fake endpoint to test group parameters (optional)
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ Integer requiredStringGroup = 56; // Integer | Required String in group parameters
+ Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters
+ Long requiredInt64Group = 56L; // Long | Required Integer in group parameters
+ Integer stringGroup = 56; // Integer | String in group parameters
+ Boolean booleanGroup = true; // Boolean | Boolean in group parameters
+ Long int64Group = 56L; // Long | Integer in group parameters
+ try {
+ 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();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **requiredStringGroup** | **Integer**| Required String in group parameters |
+ **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters |
+ **requiredInt64Group** | **Long**| Required Integer in group parameters |
+ **stringGroup** | **Integer**| String in group parameters | [optional]
+ **booleanGroup** | **Boolean**| Boolean in group parameters | [optional]
+ **int64Group** | **Long**| Integer in group parameters | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Someting wrong | - |
+
+
+## testInlineAdditionalProperties
+
+> testInlineAdditionalProperties(param)
+
+test inline additionalProperties
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ Map param = new HashMap(); // Map | request body
+ try {
+ apiInstance.testInlineAdditionalProperties(param);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **param** | **Map<String,String>**| request body |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
+
+## testJsonFormData
+
+> testJsonFormData(param, param2)
+
+test json serialization of form data
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ String param = "param_example"; // String | field1
+ String param2 = "param2_example"; // String | field2
+ try {
+ apiInstance.testJsonFormData(param, param2);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testJsonFormData");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **param** | **String**| field1 |
+ **param2** | **String**| field2 |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/x-www-form-urlencoded
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
+
+## testQueryParameterCollectionFormat
+
+> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context)
+
+
+
+To test the collection format in query parameters
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ List pipe = Arrays.asList(); // List |
+ List ioutil = Arrays.asList(); // List |
+ List http = Arrays.asList(); // List |
+ List url = Arrays.asList(); // List |
+ List context = Arrays.asList(); // List |
+ try {
+ apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pipe** | **List<String>**| |
+ **ioutil** | **List<String>**| |
+ **http** | **List<String>**| |
+ **url** | **List<String>**| |
+ **context** | **List<String>**| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Success | - |
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/FakeClassnameTags123Api.md
new file mode 100644
index 000000000000..66d3f7890a3a
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/FakeClassnameTags123Api.md
@@ -0,0 +1,81 @@
+# FakeClassnameTags123Api
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
+
+
+
+## testClassname
+
+> Client testClassname(body)
+
+To test class name in snake case
+
+To test class name in snake case
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeClassnameTags123Api;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure API key authorization: api_key_query
+ ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query");
+ api_key_query.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //api_key_query.setApiKeyPrefix("Token");
+
+ FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient);
+ Client body = new Client(); // Client | client model
+ try {
+ Client result = apiInstance.testClassname(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeClassnameTags123Api#testClassname");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Client**](Client.md)| client model |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+[api_key_query](../README.md#api_key_query)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/FileSchemaTestClass.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/FileSchemaTestClass.md
new file mode 100644
index 000000000000..3a95e27d7c09
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/FileSchemaTestClass.md
@@ -0,0 +1,13 @@
+
+
+# FileSchemaTestClass
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**file** | [**java.io.File**](java.io.File.md) | | [optional]
+**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/FormatTest.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/FormatTest.md
new file mode 100644
index 000000000000..119bcdc97e85
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/FormatTest.md
@@ -0,0 +1,25 @@
+
+
+# FormatTest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**integer** | **Integer** | | [optional]
+**int32** | **Integer** | | [optional]
+**int64** | **Long** | | [optional]
+**number** | **BigDecimal** | |
+**_float** | **Float** | | [optional]
+**_double** | **Double** | | [optional]
+**string** | **String** | | [optional]
+**_byte** | **byte[]** | |
+**binary** | **File** | | [optional]
+**date** | **LocalDate** | |
+**dateTime** | **LocalDateTime** | | [optional]
+**uuid** | **UUID** | | [optional]
+**password** | **String** | |
+**bigDecimal** | **BigDecimal** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/HasOnlyReadOnly.md
new file mode 100644
index 000000000000..4795b40ef65e
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/HasOnlyReadOnly.md
@@ -0,0 +1,13 @@
+
+
+# HasOnlyReadOnly
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **String** | | [optional] [readonly]
+**foo** | **String** | | [optional] [readonly]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/MapTest.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/MapTest.md
new file mode 100644
index 000000000000..9c3aeb6495c1
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/MapTest.md
@@ -0,0 +1,24 @@
+
+
+# MapTest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional]
+**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional]
+**directMap** | **Map<String, Boolean>** | | [optional]
+**indirectMap** | **Map<String, Boolean>** | | [optional]
+
+
+
+## Enum: Map<String, InnerEnum>
+
+Name | Value
+---- | -----
+UPPER | "UPPER"
+LOWER | "lower"
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/MixedPropertiesAndAdditionalPropertiesClass.md
new file mode 100644
index 000000000000..7d124d8969a3
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -0,0 +1,14 @@
+
+
+# MixedPropertiesAndAdditionalPropertiesClass
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uuid** | **UUID** | | [optional]
+**dateTime** | **LocalDateTime** | | [optional]
+**map** | [**Map<String, Animal>**](Animal.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Model200Response.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Model200Response.md
new file mode 100644
index 000000000000..f9928d70622c
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Model200Response.md
@@ -0,0 +1,14 @@
+
+
+# Model200Response
+
+Model for testing model name starting with number
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **Integer** | | [optional]
+**propertyClass** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelApiResponse.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelApiResponse.md
new file mode 100644
index 000000000000..14fb7f1ed27b
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelApiResponse.md
@@ -0,0 +1,14 @@
+
+
+# ModelApiResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **Integer** | | [optional]
+**type** | **String** | | [optional]
+**message** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelReturn.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelReturn.md
new file mode 100644
index 000000000000..5005d4b72392
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelReturn.md
@@ -0,0 +1,13 @@
+
+
+# ModelReturn
+
+Model for testing reserved words
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**_return** | **Integer** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Name.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Name.md
new file mode 100644
index 000000000000..b815a0b4c994
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Name.md
@@ -0,0 +1,16 @@
+
+
+# Name
+
+Model for testing model name same as property name
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **Integer** | |
+**snakeCase** | **Integer** | | [optional] [readonly]
+**property** | **String** | | [optional]
+**_123number** | **Integer** | | [optional] [readonly]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/NumberOnly.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/NumberOnly.md
new file mode 100644
index 000000000000..4b9d048546ce
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/NumberOnly.md
@@ -0,0 +1,12 @@
+
+
+# NumberOnly
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**justNumber** | **BigDecimal** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Order.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Order.md
new file mode 100644
index 000000000000..c002f5a36153
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Order.md
@@ -0,0 +1,27 @@
+
+
+# Order
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**petId** | **Long** | | [optional]
+**quantity** | **Integer** | | [optional]
+**shipDate** | **LocalDateTime** | | [optional]
+**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional]
+**complete** | **Boolean** | | [optional]
+
+
+
+## Enum: StatusEnum
+
+Name | Value
+---- | -----
+PLACED | "placed"
+APPROVED | "approved"
+DELIVERED | "delivered"
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/OuterComposite.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/OuterComposite.md
new file mode 100644
index 000000000000..594951145a3f
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/OuterComposite.md
@@ -0,0 +1,14 @@
+
+
+# OuterComposite
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**myNumber** | **BigDecimal** | | [optional]
+**myString** | **String** | | [optional]
+**myBoolean** | **Boolean** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/OuterEnum.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/OuterEnum.md
new file mode 100644
index 000000000000..1f9b723eb8e7
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/OuterEnum.md
@@ -0,0 +1,15 @@
+
+
+# OuterEnum
+
+## Enum
+
+
+* `PLACED` (value: `"placed"`)
+
+* `APPROVED` (value: `"approved"`)
+
+* `DELIVERED` (value: `"delivered"`)
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Pet.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Pet.md
new file mode 100644
index 000000000000..bdcdad6b3e60
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Pet.md
@@ -0,0 +1,27 @@
+
+
+# Pet
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**category** | [**Category**](Category.md) | | [optional]
+**name** | **String** | |
+**photoUrls** | **Set<String>** | |
+**tags** | [**List<Tag>**](Tag.md) | | [optional]
+**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional]
+
+
+
+## Enum: StatusEnum
+
+Name | Value
+---- | -----
+AVAILABLE | "available"
+PENDING | "pending"
+SOLD | "sold"
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/PetApi.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/PetApi.md
new file mode 100644
index 000000000000..c7709e17d963
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/PetApi.md
@@ -0,0 +1,658 @@
+# PetApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
+[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
+[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
+[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
+[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
+[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
+[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
+[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
+[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+
+
+
+## addPet
+
+> addPet(body)
+
+Add a new pet to the store
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
+ try {
+ apiInstance.addPet(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#addPet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: application/json, application/xml
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **405** | Invalid input | - |
+
+
+## deletePet
+
+> deletePet(petId, apiKey)
+
+Deletes a pet
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | Pet id to delete
+ String apiKey = "apiKey_example"; // String |
+ try {
+ apiInstance.deletePet(petId, apiKey);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#deletePet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| Pet id to delete |
+ **apiKey** | **String**| | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid pet value | - |
+
+
+## findPetsByStatus
+
+> List<Pet> findPetsByStatus(status)
+
+Finds Pets by status
+
+Multiple status values can be provided with comma separated strings
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ List status = Arrays.asList("available"); // List | Status values that need to be considered for filter
+ try {
+ List result = apiInstance.findPetsByStatus(status);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#findPetsByStatus");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | **List<String>**| Status values that need to be considered for filter | [enum: available, pending, sold]
+
+### Return type
+
+[**List<Pet>**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid status value | - |
+
+
+## findPetsByTags
+
+> Set<Pet> findPetsByTags(tags)
+
+Finds Pets by tags
+
+Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Set tags = Arrays.asList(); // Set | Tags to filter by
+ try {
+ Set result = apiInstance.findPetsByTags(tags);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#findPetsByTags");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **tags** | **List<String>**| Tags to filter by |
+
+### Return type
+
+[**Set<Pet>**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid tag value | - |
+
+
+## getPetById
+
+> Pet getPetById(petId)
+
+Find pet by ID
+
+Returns a single pet
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure API key authorization: api_key
+ ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
+ api_key.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //api_key.setApiKeyPrefix("Token");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | ID of pet to return
+ try {
+ Pet result = apiInstance.getPetById(petId);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#getPetById");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet to return |
+
+### Return type
+
+[**Pet**](Pet.md)
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid ID supplied | - |
+| **404** | Pet not found | - |
+
+
+## updatePet
+
+> updatePet(body)
+
+Update an existing pet
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
+ try {
+ apiInstance.updatePet(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#updatePet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: application/json, application/xml
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid ID supplied | - |
+| **404** | Pet not found | - |
+| **405** | Validation exception | - |
+
+
+## updatePetWithForm
+
+> updatePetWithForm(petId, name, status)
+
+Updates a pet in the store with form data
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | ID of pet that needs to be updated
+ String name = "name_example"; // String | Updated name of the pet
+ String status = "status_example"; // String | Updated status of the pet
+ try {
+ apiInstance.updatePetWithForm(petId, name, status);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#updatePetWithForm");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet that needs to be updated |
+ **name** | **String**| Updated name of the pet | [optional]
+ **status** | **String**| Updated status of the pet | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: application/x-www-form-urlencoded
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **405** | Invalid input | - |
+
+
+## uploadFile
+
+> ModelApiResponse uploadFile(petId, additionalMetadata, file)
+
+uploads an image
+
+### Example
+
+```java
+import java.io.File;
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | ID of pet to update
+ String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
+ File file = new File("/path/to/file"); // File | file to upload
+ try {
+ ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#uploadFile");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet to update |
+ **additionalMetadata** | **String**| Additional data to pass to server | [optional]
+ **file** | **File**| file to upload | [optional]
+
+### Return type
+
+[**ModelApiResponse**](ModelApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: multipart/form-data
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
+
+## uploadFileWithRequiredFile
+
+> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata)
+
+uploads an image (required)
+
+### Example
+
+```java
+import java.io.File;
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | ID of pet to update
+ File requiredFile = new File("/path/to/file"); // File | file to upload
+ String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
+ try {
+ ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet to update |
+ **requiredFile** | **File**| file to upload |
+ **additionalMetadata** | **String**| Additional data to pass to server | [optional]
+
+### Return type
+
+[**ModelApiResponse**](ModelApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: multipart/form-data
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ReadOnlyFirst.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ReadOnlyFirst.md
new file mode 100644
index 000000000000..a692499dc661
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ReadOnlyFirst.md
@@ -0,0 +1,13 @@
+
+
+# ReadOnlyFirst
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **String** | | [optional] [readonly]
+**baz** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/SpecialModelName.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/SpecialModelName.md
new file mode 100644
index 000000000000..934b8f0f25d7
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/SpecialModelName.md
@@ -0,0 +1,12 @@
+
+
+# SpecialModelName
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**$specialPropertyName** | **Long** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/StoreApi.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/StoreApi.md
new file mode 100644
index 000000000000..6335befe4714
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/StoreApi.md
@@ -0,0 +1,276 @@
+# StoreApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
+[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
+[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
+[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
+
+
+
+## deleteOrder
+
+> deleteOrder(orderId)
+
+Delete purchase order by ID
+
+For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.StoreApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ StoreApi apiInstance = new StoreApi(defaultClient);
+ String orderId = "orderId_example"; // String | ID of the order that needs to be deleted
+ try {
+ apiInstance.deleteOrder(orderId);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#deleteOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **String**| ID of the order that needs to be deleted |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid ID supplied | - |
+| **404** | Order not found | - |
+
+
+## getInventory
+
+> Map<String, Integer> getInventory()
+
+Returns pet inventories by status
+
+Returns a map of status codes to quantities
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.StoreApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure API key authorization: api_key
+ ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
+ api_key.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //api_key.setApiKeyPrefix("Token");
+
+ StoreApi apiInstance = new StoreApi(defaultClient);
+ try {
+ Map result = apiInstance.getInventory();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#getInventory");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+**Map<String, Integer>**
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
+
+## getOrderById
+
+> Order getOrderById(orderId)
+
+Find purchase order by ID
+
+For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.StoreApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ StoreApi apiInstance = new StoreApi(defaultClient);
+ Long orderId = 56L; // Long | ID of pet that needs to be fetched
+ try {
+ Order result = apiInstance.getOrderById(orderId);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#getOrderById");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **Long**| ID of pet that needs to be fetched |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid ID supplied | - |
+| **404** | Order not found | - |
+
+
+## placeOrder
+
+> Order placeOrder(body)
+
+Place an order for a pet
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.StoreApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ StoreApi apiInstance = new StoreApi(defaultClient);
+ Order body = new Order(); // Order | order placed for purchasing the pet
+ try {
+ Order result = apiInstance.placeOrder(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#placeOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Order**](Order.md)| order placed for purchasing the pet |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid Order | - |
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Tag.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Tag.md
new file mode 100644
index 000000000000..f24eba7d222e
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/Tag.md
@@ -0,0 +1,13 @@
+
+
+# Tag
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/TypeHolderDefault.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/TypeHolderDefault.md
new file mode 100644
index 000000000000..e28c7a9df589
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/TypeHolderDefault.md
@@ -0,0 +1,16 @@
+
+
+# TypeHolderDefault
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**stringItem** | **String** | |
+**numberItem** | **BigDecimal** | |
+**integerItem** | **Integer** | |
+**boolItem** | **Boolean** | |
+**arrayItem** | **List<Integer>** | |
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/TypeHolderExample.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/TypeHolderExample.md
new file mode 100644
index 000000000000..96f0d4bebf44
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/TypeHolderExample.md
@@ -0,0 +1,17 @@
+
+
+# TypeHolderExample
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**stringItem** | **String** | |
+**numberItem** | **BigDecimal** | |
+**floatItem** | **Float** | |
+**integerItem** | **Integer** | |
+**boolItem** | **Boolean** | |
+**arrayItem** | **List<Integer>** | |
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/User.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/User.md
new file mode 100644
index 000000000000..c4ea94b7fc17
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/User.md
@@ -0,0 +1,19 @@
+
+
+# User
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**username** | **String** | | [optional]
+**firstName** | **String** | | [optional]
+**lastName** | **String** | | [optional]
+**email** | **String** | | [optional]
+**password** | **String** | | [optional]
+**phone** | **String** | | [optional]
+**userStatus** | **Integer** | User Status | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/UserApi.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/UserApi.md
new file mode 100644
index 000000000000..d81d5f802230
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/UserApi.md
@@ -0,0 +1,525 @@
+# UserApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**createUser**](UserApi.md#createUser) | **POST** /user | Create user
+[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
+[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
+[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
+[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
+[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
+[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
+[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
+
+
+
+## createUser
+
+> createUser(body)
+
+Create user
+
+This can only be done by the logged in user.
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ User body = new User(); // User | Created user object
+ try {
+ apiInstance.createUser(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**User**](User.md)| Created user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **0** | successful operation | - |
+
+
+## createUsersWithArrayInput
+
+> createUsersWithArrayInput(body)
+
+Creates list of users with given input array
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ List body = Arrays.asList(); // List | List of user object
+ try {
+ apiInstance.createUsersWithArrayInput(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**List<User>**](User.md)| List of user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **0** | successful operation | - |
+
+
+## createUsersWithListInput
+
+> createUsersWithListInput(body)
+
+Creates list of users with given input array
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ List body = Arrays.asList(); // List | List of user object
+ try {
+ apiInstance.createUsersWithListInput(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUsersWithListInput");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**List<User>**](User.md)| List of user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **0** | successful operation | - |
+
+
+## deleteUser
+
+> deleteUser(username)
+
+Delete user
+
+This can only be done by the logged in user.
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ String username = "username_example"; // String | The name that needs to be deleted
+ try {
+ apiInstance.deleteUser(username);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#deleteUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The name that needs to be deleted |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid username supplied | - |
+| **404** | User not found | - |
+
+
+## getUserByName
+
+> User getUserByName(username)
+
+Get user by user name
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
+ try {
+ User result = apiInstance.getUserByName(username);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#getUserByName");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The name that needs to be fetched. Use user1 for testing. |
+
+### Return type
+
+[**User**](User.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid username supplied | - |
+| **404** | User not found | - |
+
+
+## loginUser
+
+> String loginUser(username, password)
+
+Logs user into the system
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ String username = "username_example"; // String | The user name for login
+ String password = "password_example"; // String | The password for login in clear text
+ try {
+ String result = apiInstance.loginUser(username, password);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#loginUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The user name for login |
+ **password** | **String**| The password for login in clear text |
+
+### Return type
+
+**String**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user * X-Expires-After - date in UTC when token expires |
+| **400** | Invalid username/password supplied | - |
+
+
+## logoutUser
+
+> logoutUser()
+
+Logs out current logged in user session
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ try {
+ apiInstance.logoutUser();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#logoutUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **0** | successful operation | - |
+
+
+## updateUser
+
+> updateUser(username, body)
+
+Updated user
+
+This can only be done by the logged in user.
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ String username = "username_example"; // String | name that need to be deleted
+ User body = new User(); // User | Updated user object
+ try {
+ apiInstance.updateUser(username, body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#updateUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| name that need to be deleted |
+ **body** | [**User**](User.md)| Updated user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid user supplied | - |
+| **404** | User not found | - |
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/XmlItem.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/XmlItem.md
new file mode 100644
index 000000000000..096fdc7b09ac
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/XmlItem.md
@@ -0,0 +1,40 @@
+
+
+# XmlItem
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**attributeString** | **String** | | [optional]
+**attributeNumber** | **BigDecimal** | | [optional]
+**attributeInteger** | **Integer** | | [optional]
+**attributeBoolean** | **Boolean** | | [optional]
+**wrappedArray** | **List<Integer>** | | [optional]
+**nameString** | **String** | | [optional]
+**nameNumber** | **BigDecimal** | | [optional]
+**nameInteger** | **Integer** | | [optional]
+**nameBoolean** | **Boolean** | | [optional]
+**nameArray** | **List<Integer>** | | [optional]
+**nameWrappedArray** | **List<Integer>** | | [optional]
+**prefixString** | **String** | | [optional]
+**prefixNumber** | **BigDecimal** | | [optional]
+**prefixInteger** | **Integer** | | [optional]
+**prefixBoolean** | **Boolean** | | [optional]
+**prefixArray** | **List<Integer>** | | [optional]
+**prefixWrappedArray** | **List<Integer>** | | [optional]
+**namespaceString** | **String** | | [optional]
+**namespaceNumber** | **BigDecimal** | | [optional]
+**namespaceInteger** | **Integer** | | [optional]
+**namespaceBoolean** | **Boolean** | | [optional]
+**namespaceArray** | **List<Integer>** | | [optional]
+**namespaceWrappedArray** | **List<Integer>** | | [optional]
+**prefixNsString** | **String** | | [optional]
+**prefixNsNumber** | **BigDecimal** | | [optional]
+**prefixNsInteger** | **Integer** | | [optional]
+**prefixNsBoolean** | **Boolean** | | [optional]
+**prefixNsArray** | **List<Integer>** | | [optional]
+**prefixNsWrappedArray** | **List<Integer>** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/git_push.sh b/samples/client/petstore/java/jersey2-java8-localdatetime/git_push.sh
new file mode 100644
index 000000000000..ced3be2b0c7b
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/git_push.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+git_host=$4
+
+if [ "$git_host" = "" ]; then
+ git_host="github.com"
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
+fi
+
+if [ "$git_user_id" = "" ]; then
+ git_user_id="GIT_USER_ID"
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+ git_repo_id="GIT_REPO_ID"
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+ release_note="Minor update"
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=`git remote`
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+ if [ "$GIT_TOKEN" = "" ]; then
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
+ fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/gradle.properties b/samples/client/petstore/java/jersey2-java8-localdatetime/gradle.properties
new file mode 100644
index 000000000000..05644f0754af
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/gradle.properties
@@ -0,0 +1,2 @@
+# Uncomment to build for Android
+#target = android
\ No newline at end of file
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/jersey2-java8-localdatetime/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 000000000000..e708b1c023ec
Binary files /dev/null and b/samples/client/petstore/java/jersey2-java8-localdatetime/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/jersey2-java8-localdatetime/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 000000000000..4d9ca1649142
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/gradlew b/samples/client/petstore/java/jersey2-java8-localdatetime/gradlew
new file mode 100644
index 000000000000..4f906e0c811f
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/gradlew
@@ -0,0 +1,185 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/gradlew.bat b/samples/client/petstore/java/jersey2-java8-localdatetime/gradlew.bat
new file mode 100644
index 000000000000..107acd32c4e6
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/gradlew.bat
@@ -0,0 +1,89 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml b/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml
new file mode 100644
index 000000000000..c850d2d0edbb
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml
@@ -0,0 +1,313 @@
+
+ 4.0.0
+ org.openapitools
+ petstore-jersey2-java8-localdatetime
+ jar
+ petstore-jersey2-java8-localdatetime
+ 1.0.0
+ https://github.com/openapitools/openapi-generator
+ OpenAPI Java
+
+ scm:git:git@github.com:openapitools/openapi-generator.git
+ scm:git:git@github.com:openapitools/openapi-generator.git
+ https://github.com/openapitools/openapi-generator
+
+
+
+
+ Unlicense
+ https://www.apache.org/licenses/LICENSE-2.0.html
+ repo
+
+
+
+
+
+ OpenAPI-Generator Contributors
+ team@openapitools.org
+ OpenAPITools.org
+ http://openapitools.org
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ 3.0.0-M1
+
+
+ enforce-maven
+
+ enforce
+
+
+
+
+ 2.2.0
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 3.0.0-M4
+
+
+
+ loggerPath
+ conf/log4j.properties
+
+
+ -Xms512m -Xmx1500m
+ methods
+ 10
+ false
+
+
+
+ maven-dependency-plugin
+
+
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}/lib
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 2.6
+
+
+
+ jar
+ test-jar
+
+
+
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+ 1.10
+
+
+ add_sources
+ generate-sources
+
+ add-source
+
+
+
+ src/main/java
+
+
+
+
+ add_test_sources
+ generate-test-sources
+
+ add-test-source
+
+
+
+ src/test/java
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.8.1
+
+ 1.8
+ 1.8
+ true
+ 128m
+ 512m
+
+ -Xlint:all
+ -J-Xss4m
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.1.1
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+ none
+ 1.8
+
+
+ http.response.details
+ a
+ Http Response Details:
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 2.2.1
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+
+
+
+
+ sign-artifacts
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 1.5
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+
+
+
+
+
+
+ io.swagger
+ swagger-annotations
+ ${swagger-annotations-version}
+
+
+
+
+ com.google.code.findbugs
+ jsr305
+ 3.0.2
+
+
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey-version}
+
+
+ org.glassfish.jersey.inject
+ jersey-hk2
+ ${jersey-version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-multipart
+ ${jersey-version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey-version}
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson-databind-version}
+
+
+ org.openapitools
+ jackson-databind-nullable
+ ${jackson-databind-nullable-version}
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ ${jackson-version}
+
+
+ com.github.scribejava
+ scribejava-apis
+ ${scribejava-apis-version}
+
+
+ javax.annotation
+ javax.annotation-api
+ ${javax-annotation-version}
+ provided
+
+
+ org.glassfish.jersey.connectors
+ jersey-apache-connector
+ ${jersey-version}
+
+
+
+ junit
+ junit
+ ${junit-version}
+ test
+
+
+
+ UTF-8
+ 1.6.1
+ 2.30.1
+ 2.10.4
+ 2.10.4
+ 0.2.1
+ 1.3.2
+ 4.13.1
+ 6.9.0
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/settings.gradle b/samples/client/petstore/java/jersey2-java8-localdatetime/settings.gradle
new file mode 100644
index 000000000000..dff890b718a1
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = "petstore-jersey2-java8-localdatetime"
\ No newline at end of file
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/AndroidManifest.xml b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/AndroidManifest.xml
new file mode 100644
index 000000000000..54fbcb3da1e8
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/AndroidManifest.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
new file mode 100644
index 000000000000..7399a873be43
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
@@ -0,0 +1,1258 @@
+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 java.io.IOException;
+import java.io.InputStream;
+
+import java.net.URI;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import java.security.cert.X509Certificate;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.nio.file.Files;
+import java.nio.file.StandardCopyOption;
+import org.glassfish.jersey.logging.LoggingFeature;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+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.time.OffsetDateTime;
+
+import java.net.URLEncoder;
+
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+
+import java.text.DateFormat;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.openapitools.client.auth.Authentication;
+import org.openapitools.client.auth.HttpBasicAuth;
+import org.openapitools.client.auth.HttpBearerAuth;
+import org.openapitools.client.auth.ApiKeyAuth;
+import org.openapitools.client.auth.OAuth;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class ApiClient extends JavaTimeFormatter {
+ protected Map defaultHeaderMap = new HashMap();
+ protected Map defaultCookieMap = new HashMap();
+ protected String basePath = "http://petstore.swagger.io:80/v2";
+ protected String userAgent;
+ private static final Logger log = Logger.getLogger(ApiClient.class.getName());
+
+ 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 ClientConfig clientConfig;
+ protected int connectionTimeout = 0;
+ private int readTimeout = 0;
+
+ protected Client httpClient;
+ protected JSON json;
+ protected String tempFolderPath = null;
+
+ protected Map authentications;
+ protected Map authenticationLookup;
+
+ protected DateFormat dateFormat;
+
+ /**
+ * Constructs a new ApiClient with default parameters.
+ */
+ public ApiClient() {
+ this(null);
+ }
+
+ /**
+ * Constructs a new ApiClient with the specified authentication parameters.
+ *
+ * @param authMap A hash map containing authentication parameters.
+ */
+ public ApiClient(Map authMap) {
+ json = new JSON();
+ httpClient = buildHttpClient();
+
+ this.dateFormat = new RFC3339DateFormat();
+
+ // Set default User-Agent.
+ setUserAgent("OpenAPI-Generator/1.0.0/java");
+
+ // Setup authentications (key: authentication name, value: authentication).
+ authentications = new HashMap();
+ Authentication auth = null;
+ if (authMap != null) {
+ auth = authMap.get("api_key");
+ }
+ if (auth instanceof ApiKeyAuth) {
+ authentications.put("api_key", auth);
+ } else {
+ authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
+ }
+ if (authMap != null) {
+ auth = authMap.get("api_key_query");
+ }
+ if (auth instanceof ApiKeyAuth) {
+ authentications.put("api_key_query", auth);
+ } else {
+ authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
+ }
+ if (authMap != null) {
+ auth = authMap.get("http_basic_test");
+ }
+ if (auth instanceof HttpBasicAuth) {
+ authentications.put("http_basic_test", auth);
+ } else {
+ authentications.put("http_basic_test", new HttpBasicAuth());
+ }
+ if (authMap != null) {
+ auth = authMap.get("petstore_auth");
+ }
+ if (auth instanceof OAuth) {
+ authentications.put("petstore_auth", auth);
+ } else {
+ authentications.put("petstore_auth", new OAuth(basePath, ""));
+ }
+ // Prevent the authentications from being modified.
+ authentications = Collections.unmodifiableMap(authentications);
+
+ // 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;
+ }
+
+ /**
+ * Returns the base URL to the location where the OpenAPI document is being served.
+ *
+ * @return The base URL to the target host.
+ */
+ public String getBasePath() {
+ return basePath;
+ }
+
+ /**
+ * Sets the base URL to the location where the OpenAPI document is being served.
+ *
+ * @param basePath The base URL to the target host.
+ */
+ 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() {
+ if (serverIndex != null) {
+ 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(Map 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, isDebugging());
+ 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) {
+ userAgent = userAgent;
+ addDefaultHeader("User-Agent", userAgent);
+ return this;
+ }
+
+ /**
+ * Get the User-Agent header's value.
+ * @return User-Agent string
+ */
+ public String getUserAgent(){
+ return userAgent;
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * Gets the client config.
+ * @return Client config
+ */
+ public ClientConfig getClientConfig() {
+ return clientConfig;
+ }
+
+ /**
+ * Set the client config.
+ *
+ * @param clientConfig Set the client config
+ * @return API client
+ */
+ public ApiClient setClientConfig(ClientConfig clientConfig) {
+ this.clientConfig = clientConfig;
+ // Rebuild HTTP Client according to the new "clientConfig" value.
+ this.httpClient = buildHttpClient();
+ 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();
+ 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 OffsetDateTime) {
+ return formatOffsetDateTime((OffsetDateTime) 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;
+ }
+
+ if (valueCollection.isEmpty()){
+ return params;
+ }
+
+ // 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;
+ }
+
+ 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 = "|";
+ }
+
+ 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, boolean isBodyNullable) 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
+ if (isBodyNullable) { // payload is nullable
+ if (obj instanceof String) {
+ entity = Entity.entity(obj == null ? "null" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType);
+ } else {
+ entity = Entity.entity(obj == null ? "null" : obj, contentType);
+ }
+ } else {
+ if (obj instanceof String) {
+ entity = Entity.entity(obj == null ? "" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType);
+ } else {
+ entity = Entity.entity(obj == null ? "" : 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
+ * @param isBodyNullable True if the body is nullable
+ * @return String
+ * @throws ApiException API exception
+ */
+ public String serializeToString(Object obj, Map formParams, String contentType, boolean isBodyNullable) 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") + "&";
+ }
+
+ if (formString.length() == 0) { // empty string
+ return formString;
+ } else {
+ return formString.substring(0, formString.length() - 1);
+ }
+ } else {
+ if (isBodyNullable) {
+ return obj == null ? "null" : json.getMapper().writeValueAsString(obj);
+ } else {
+ return obj == null ? "" : json.getMapper().writeValueAsString(obj);
+ }
+ }
+ } catch (Exception ex) {
+ throw new ApiException("Failed to perform serializeToString: " + ex.toString());
+ }
+ }
+
+ /**
+ * 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;
+ }
+
+ 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;
+ }
+
+ String contentType = null;
+ List