diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh
index 6cba564ffbf..962a13584af 100755
--- a/CI/circle_parallel.sh
+++ b/CI/circle_parallel.sh
@@ -53,9 +53,9 @@ elif [ "$NODE_INDEX" = "3" ]; then
#./configure --enable-optimizations
#sudo make altinstall
pyenv install --list
- pyenv install 3.6.3
+ pyenv install 3.7.12
pyenv install 2.7.14
- pyenv global 3.6.3
+ pyenv global 3.7.12
# Install node@stable (for angular 6)
set +e
diff --git a/bin/configs/python-nextgen-aiohttp.yaml b/bin/configs/python-nextgen-aiohttp.yaml
new file mode 100644
index 00000000000..4d71a6d3d61
--- /dev/null
+++ b/bin/configs/python-nextgen-aiohttp.yaml
@@ -0,0 +1,7 @@
+generatorName: python-nextgen
+outputDir: samples/openapi3/client/petstore/python-nextgen-aiohttp
+inputSpec: modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/python-nextgen
+library: asyncio
+additionalProperties:
+ packageName: petstore_api
diff --git a/bin/configs/python-nextgen.yaml b/bin/configs/python-nextgen.yaml
new file mode 100644
index 00000000000..c2c09ee0147
--- /dev/null
+++ b/bin/configs/python-nextgen.yaml
@@ -0,0 +1,8 @@
+generatorName: python-nextgen
+outputDir: samples/openapi3/client/petstore/python-nextgen
+inputSpec: modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/python-nextgen
+additionalProperties:
+ packageName: petstore_api
+ useOneOfDiscriminatorLookup: "true"
+ disallowAdditionalPropertiesIfNotPresent: false
diff --git a/docs/generators.md b/docs/generators.md
index cd0466f9ad5..f05f73224e4 100644
--- a/docs/generators.md
+++ b/docs/generators.md
@@ -52,6 +52,7 @@ The following generators are available:
* [powershell (beta)](generators/powershell.md)
* [python](generators/python.md)
* [python-legacy](generators/python-legacy.md)
+* [python-nextgen (beta)](generators/python-nextgen.md)
* [python-prior](generators/python-prior.md)
* [r](generators/r.md)
* [ruby](generators/ruby.md)
diff --git a/docs/generators/python-legacy.md b/docs/generators/python-legacy.md
index 0af42bd30b9..3d0b1165a61 100644
--- a/docs/generators/python-legacy.md
+++ b/docs/generators/python-legacy.md
@@ -45,6 +45,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
## LANGUAGE PRIMITIVES
+Dict
+List
bool
bytes
date
diff --git a/docs/generators/python-nextgen.md b/docs/generators/python-nextgen.md
new file mode 100644
index 00000000000..da228948cf6
--- /dev/null
+++ b/docs/generators/python-nextgen.md
@@ -0,0 +1,225 @@
+---
+title: Documentation for the python-nextgen Generator
+---
+
+## METADATA
+
+| Property | Value | Notes |
+| -------- | ----- | ----- |
+| generator name | python-nextgen | pass this to the generate command after -g |
+| generator stability | BETA | |
+| generator type | CLIENT | |
+| generator language | Python | |
+| generator language version | 3.7+ | |
+| generator default templating engine | mustache | |
+| helpTxt | Generates a Python client library. | |
+
+## CONFIG OPTIONS
+These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
+
+| Option | Description | Values | Default |
+| ------ | ----------- | ------ | ------- |
+|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|
+|generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false|
+|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
+|library|library template (sub-template) to use: asyncio, tornado (deprecated), urllib3| |urllib3|
+|packageName|python package name (convention: snake_case).| |openapi_client|
+|packageUrl|python package URL.| |null|
+|packageVersion|python package version.| |1.0.0|
+|projectName|python project name in setup.py (e.g. petstore-api).| |null|
+|recursionLimit|Set the recursion limit. If not set, use the system default value.| |null|
+
+## IMPORT MAPPING
+
+| Type/Alias | Imports |
+| ---------- | ------- |
+
+
+## INSTANTIATION TYPES
+
+| Type/Alias | Instantiated By |
+| ---------- | --------------- |
+
+
+## LANGUAGE PRIMITIVES
+
+
+Dict
+List
+bool
+bytes
+date
+datetime
+decimal.Decimal
+dict
+float
+int
+list
+object
+str
+
+
+## RESERVED WORDS
+
+
+and
+as
+assert
+async
+await
+base64
+break
+class
+continue
+date
+def
+del
+elif
+else
+except
+exec
+false
+finally
+for
+from
+global
+if
+import
+in
+is
+json
+lambda
+none
+nonlocal
+not
+or
+pass
+print
+property
+raise
+return
+schema
+self
+true
+try
+while
+with
+yield
+
+
+## FEATURE SET
+
+
+### Client Modification Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|BasePath|✗|ToolingExtension
+|Authorizations|✗|ToolingExtension
+|UserAgent|✗|ToolingExtension
+|MockServer|✗|ToolingExtension
+
+### Data Type Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Custom|✗|OAS2,OAS3
+|Int32|✓|OAS2,OAS3
+|Int64|✓|OAS2,OAS3
+|Float|✓|OAS2,OAS3
+|Double|✓|OAS2,OAS3
+|Decimal|✓|ToolingExtension
+|String|✓|OAS2,OAS3
+|Byte|✓|OAS2,OAS3
+|Binary|✓|OAS2,OAS3
+|Boolean|✓|OAS2,OAS3
+|Date|✓|OAS2,OAS3
+|DateTime|✓|OAS2,OAS3
+|Password|✓|OAS2,OAS3
+|File|✓|OAS2
+|Uuid|✗|
+|Array|✓|OAS2,OAS3
+|Null|✗|OAS3
+|AnyType|✗|OAS2,OAS3
+|Object|✓|OAS2,OAS3
+|Maps|✓|ToolingExtension
+|CollectionFormat|✓|OAS2
+|CollectionFormatMulti|✓|OAS2
+|Enum|✓|OAS2,OAS3
+|ArrayOfEnum|✓|ToolingExtension
+|ArrayOfModel|✓|ToolingExtension
+|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
+|ArrayOfCollectionOfModel|✓|ToolingExtension
+|ArrayOfCollectionOfEnum|✓|ToolingExtension
+|MapOfEnum|✓|ToolingExtension
+|MapOfModel|✓|ToolingExtension
+|MapOfCollectionOfPrimitives|✓|ToolingExtension
+|MapOfCollectionOfModel|✓|ToolingExtension
+|MapOfCollectionOfEnum|✓|ToolingExtension
+
+### Documentation Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Readme|✓|ToolingExtension
+|Model|✓|ToolingExtension
+|Api|✓|ToolingExtension
+
+### Global Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Host|✓|OAS2,OAS3
+|BasePath|✓|OAS2,OAS3
+|Info|✓|OAS2,OAS3
+|Schemes|✗|OAS2,OAS3
+|PartialSchemes|✓|OAS2,OAS3
+|Consumes|✓|OAS2
+|Produces|✓|OAS2
+|ExternalDocumentation|✓|OAS2,OAS3
+|Examples|✓|OAS2,OAS3
+|XMLStructureDefinitions|✗|OAS2,OAS3
+|MultiServer|✗|OAS3
+|ParameterizedServer|✗|OAS3
+|ParameterStyling|✗|OAS3
+|Callbacks|✗|OAS3
+|LinkObjects|✗|OAS3
+
+### Parameter Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Path|✓|OAS2,OAS3
+|Query|✓|OAS2,OAS3
+|Header|✓|OAS2,OAS3
+|Body|✓|OAS2
+|FormUnencoded|✓|OAS2
+|FormMultipart|✓|OAS2
+|Cookie|✗|OAS3
+
+### Schema Support Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Simple|✓|OAS2,OAS3
+|Composite|✓|OAS2,OAS3
+|Polymorphism|✓|OAS2,OAS3
+|Union|✗|OAS3
+|allOf|✓|OAS2,OAS3
+|anyOf|✓|OAS3
+|oneOf|✓|OAS3
+|not|✗|OAS3
+
+### Security Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|BasicAuth|✓|OAS2,OAS3
+|ApiKey|✓|OAS2,OAS3
+|OpenIDConnect|✗|OAS3
+|BearerToken|✓|OAS3
+|OAuth2_Implicit|✓|OAS2,OAS3
+|OAuth2_Password|✗|OAS2,OAS3
+|OAuth2_ClientCredentials|✗|OAS2,OAS3
+|OAuth2_AuthorizationCode|✗|OAS2,OAS3
+
+### Wire Format Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|JSON|✓|OAS2,OAS3
+|XML|✓|OAS2,OAS3
+|PROTOBUF|✗|ToolingExtension
+|Custom|✓|OAS2,OAS3
diff --git a/docs/generators/python-prior.md b/docs/generators/python-prior.md
index 00a89120d77..82e50b4f4a2 100644
--- a/docs/generators/python-prior.md
+++ b/docs/generators/python-prior.md
@@ -47,6 +47,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
## LANGUAGE PRIMITIVES
+Dict
+List
bool
bytes
date
diff --git a/docs/generators/python.md b/docs/generators/python.md
index 4cbf616d091..b62d4af85bc 100644
--- a/docs/generators/python.md
+++ b/docs/generators/python.md
@@ -47,6 +47,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
## LANGUAGE PRIMITIVES
+Dict
+List
bool
bytes
date
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
index 30e1c099c5e..f39b9940815 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
@@ -637,14 +637,29 @@ public class DefaultCodegen implements CodegenConfig {
}
public void setCircularReferences(Map models) {
- final Map> dependencyMap = models.entrySet().stream()
- .collect(Collectors.toMap(Entry::getKey, entry -> getModelDependencies(entry.getValue())));
+ // for allVars
+ final Map> allVarsDependencyMap = models.entrySet().stream()
+ .collect(Collectors.toMap(Entry::getKey, entry -> getModelDependencies(entry.getValue().getAllVars())));
- models.keySet().forEach(name -> setCircularReferencesOnProperties(name, dependencyMap));
+ models.keySet().forEach(name -> setCircularReferencesOnProperties(name, allVarsDependencyMap));
+
+ // for vars
+ final Map> varsDependencyMap = models.entrySet().stream()
+ .collect(Collectors.toMap(Entry::getKey, entry -> getModelDependencies(entry.getValue().getVars())));
+
+ models.keySet().forEach(name -> setCircularReferencesOnProperties(name, varsDependencyMap));
+
+ // for oneOf
+ final Map> oneOfDependencyMap = models.entrySet().stream()
+ .collect(Collectors.toMap(Entry::getKey, entry -> getModelDependencies(
+ (entry.getValue().getComposedSchemas() != null && entry.getValue().getComposedSchemas().getOneOf() != null)
+ ? entry.getValue().getComposedSchemas().getOneOf() : new ArrayList())));
+
+ models.keySet().forEach(name -> setCircularReferencesOnProperties(name, oneOfDependencyMap));
}
- private List getModelDependencies(CodegenModel model) {
- return model.getAllVars().stream()
+ private List getModelDependencies( List vars) {
+ return vars.stream()
.map(prop -> {
if (prop.isContainer) {
return prop.items.dataType == null ? null : prop;
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java
index fa38462af85..b523fe3a808 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java
@@ -44,6 +44,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
protected String packageName = "openapi_client";
protected String packageVersion = "1.0.0";
protected String projectName; // for setup.py, e.g. petstore-api
+ private Map schemaKeyToModelNameCache = new HashMap<>();
public AbstractPythonCodegen() {
super();
@@ -68,6 +69,8 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
languageSpecificPrimitives.add("float");
languageSpecificPrimitives.add("list");
languageSpecificPrimitives.add("dict");
+ languageSpecificPrimitives.add("List");
+ languageSpecificPrimitives.add("Dict");
languageSpecificPrimitives.add("bool");
languageSpecificPrimitives.add("str");
languageSpecificPrimitives.add("datetime");
@@ -121,19 +124,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
return "_" + name;
}
- @Override
- public String getTypeDeclaration(Schema p) {
- if (ModelUtils.isArraySchema(p)) {
- ArraySchema ap = (ArraySchema) p;
- Schema inner = ap.getItems();
- return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
- } else if (ModelUtils.isMapSchema(p)) {
- Schema inner = getAdditionalProperties(p);
- return getSchemaType(p) + "(str, " + getTypeDeclaration(inner) + ")";
- }
- return super.getTypeDeclaration(p);
- }
/**
* Return the default value of the property
@@ -634,6 +625,18 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
@Override
public String toModelName(String name) {
+ // check if schema-mapping has a different model for this class, so we can use it
+ // instead of the auto-generated one.
+ if (schemaMapping.containsKey(name)) {
+ return schemaMapping.get(name);
+ }
+
+ // memoization
+ String origName = name;
+ if (schemaKeyToModelNameCache.containsKey(origName)) {
+ return schemaKeyToModelNameCache.get(origName);
+ }
+
String sanitizedName = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
// remove dollar sign
sanitizedName = sanitizedName.replaceAll("$", "");
@@ -659,6 +662,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
if (isReservedWord(camelizedName)) {
String modelName = "Model" + camelizedName; // e.g. return => ModelReturn (after camelize)
LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", camelizedName, modelName);
+ schemaKeyToModelNameCache.put(origName, modelName);
return modelName;
}
@@ -666,9 +670,11 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
if (camelizedName.matches("^\\d.*")) {
String modelName = "Model" + camelizedName; // e.g. return => ModelReturn (after camelize)
LOGGER.warn("{} (model name starts with number) cannot be used as model name. Renamed to {}", camelizedName, modelName);
+ schemaKeyToModelNameCache.put(origName, modelName);
return modelName;
}
+ schemaKeyToModelNameCache.put(origName, camelizedName);
return camelizedName;
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java
index c088f3861a7..b33c6825519 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java
@@ -17,10 +17,13 @@
package org.openapitools.codegen.languages;
+import io.swagger.v3.oas.models.media.ArraySchema;
+import io.swagger.v3.oas.models.media.Schema;
import org.apache.commons.lang3.StringUtils;
import org.openapitools.codegen.*;
import org.openapitools.codegen.meta.features.*;
import org.openapitools.codegen.model.ModelsMap;
+import org.openapitools.codegen.utils.ModelUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -445,4 +448,18 @@ public class PythonLegacyClientCodegen extends AbstractPythonCodegen implements
@Override
public String generatorLanguageVersion() { return "2.7 and 3.4+"; };
+
+ @Override
+ public String getTypeDeclaration(Schema p) {
+ if (ModelUtils.isArraySchema(p)) {
+ ArraySchema ap = (ArraySchema) p;
+ Schema inner = ap.getItems();
+ return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
+ } else if (ModelUtils.isMapSchema(p)) {
+ Schema inner = getAdditionalProperties(p);
+
+ return getSchemaType(p) + "[str, " + getTypeDeclaration(inner) + "]";
+ }
+ return super.getTypeDeclaration(p);
+ }
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonNextgenClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonNextgenClientCodegen.java
new file mode 100644
index 00000000000..60fac6f4b41
--- /dev/null
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonNextgenClientCodegen.java
@@ -0,0 +1,1314 @@
+/*
+ * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
+ * Copyright 2018 SmartBear Software
+ *
+ * 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.
+ */
+
+package org.openapitools.codegen.languages;
+
+import io.swagger.v3.oas.models.media.ArraySchema;
+import io.swagger.v3.oas.models.media.Schema;
+import io.swagger.v3.oas.models.security.SecurityScheme;
+import org.apache.commons.lang3.StringUtils;
+import org.openapitools.codegen.*;
+import org.openapitools.codegen.meta.GeneratorMetadata;
+import org.openapitools.codegen.meta.Stability;
+import org.openapitools.codegen.meta.features.*;
+import org.openapitools.codegen.meta.features.*;
+import org.openapitools.codegen.model.ModelMap;
+import org.openapitools.codegen.model.ModelsMap;
+import org.openapitools.codegen.model.OperationMap;
+import org.openapitools.codegen.model.OperationsMap;
+import org.openapitools.codegen.utils.ModelUtils;
+import org.openapitools.codegen.utils.ProcessUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.util.*;
+
+import static org.openapitools.codegen.utils.StringUtils.underscore;
+
+public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements CodegenConfig {
+ private final Logger LOGGER = LoggerFactory.getLogger(PythonNextgenClientCodegen.class);
+
+ public static final String PACKAGE_URL = "packageUrl";
+ public static final String DEFAULT_LIBRARY = "urllib3";
+ public static final String RECURSION_LIMIT = "recursionLimit";
+ public static final String PYTHON_ATTR_NONE_IF_UNSET = "pythonAttrNoneIfUnset";
+
+ protected String packageUrl;
+ protected String apiDocPath = "docs" + File.separator;
+ protected String modelDocPath = "docs" + File.separator;
+ protected boolean hasModelsToImport = Boolean.FALSE;
+ protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup
+
+ protected Map regexModifiers;
+
+ private String testFolder;
+
+ public PythonNextgenClientCodegen() {
+ super();
+
+ // force sortParamsByRequiredFlag to true to make the api method signature less complicated
+ sortParamsByRequiredFlag = true;
+
+ modifyFeatureSet(features -> features
+ .includeDocumentationFeatures(DocumentationFeature.Readme)
+ .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
+ .securityFeatures(EnumSet.of(
+ SecurityFeature.BasicAuth,
+ SecurityFeature.BearerToken,
+ SecurityFeature.ApiKey,
+ SecurityFeature.OAuth2_Implicit
+ ))
+ .excludeGlobalFeatures(
+ GlobalFeature.XMLStructureDefinitions,
+ GlobalFeature.Callbacks,
+ GlobalFeature.LinkObjects,
+ GlobalFeature.ParameterStyling
+ )
+ .includeSchemaSupportFeatures(
+ SchemaSupportFeature.Polymorphism,
+ SchemaSupportFeature.allOf,
+ SchemaSupportFeature.oneOf,
+ SchemaSupportFeature.anyOf
+ )
+ .excludeParameterFeatures(
+ ParameterFeature.Cookie
+ )
+ );
+
+ generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
+ .stability(Stability.BETA)
+ .build();
+
+ // clear import mapping (from default generator) as python does not use it
+ // at the moment
+ importMapping.clear();
+
+ // override type mapping in abstract python codegen
+ typeMapping.put("array", "List");
+ typeMapping.put("set", "List");
+ typeMapping.put("map", "Dict");
+ typeMapping.put("file", "str");
+ typeMapping.put("decimal", "decimal.Decimal");
+
+ languageSpecificPrimitives.remove("file");
+ languageSpecificPrimitives.add("decimal.Decimal");
+
+ supportsInheritance = true;
+ modelPackage = "models";
+ apiPackage = "api";
+ outputFolder = "generated-code" + File.separatorChar + "python";
+
+ modelTemplateFiles.put("model.mustache", ".py");
+ apiTemplateFiles.put("api.mustache", ".py");
+
+ modelTestTemplateFiles.put("model_test.mustache", ".py");
+ apiTestTemplateFiles.put("api_test.mustache", ".py");
+
+ embeddedTemplateDir = templateDir = "python-nextgen";
+
+ modelDocTemplateFiles.put("model_doc.mustache", ".md");
+ apiDocTemplateFiles.put("api_doc.mustache", ".md");
+
+ testFolder = "test";
+
+ // default HIDE_GENERATION_TIMESTAMP to true
+ hideGenerationTimestamp = Boolean.TRUE;
+
+ // from https://docs.python.org/3/reference/lexical_analysis.html#keywords
+ setReservedWordsLowerCase(
+ Arrays.asList(
+ // pydantic keyword
+ "schema", "base64", "json",
+ "date",
+ // @property
+ "property",
+ // python reserved words
+ "and", "del", "from", "not", "while", "as", "elif", "global", "or", "with",
+ "assert", "else", "if", "pass", "yield", "break", "except", "import",
+ "print", "class", "exec", "in", "raise", "continue", "finally", "is",
+ "return", "def", "for", "lambda", "try", "self", "nonlocal", "None", "True",
+ "False", "async", "await"));
+
+ regexModifiers = new HashMap();
+ regexModifiers.put('i', "IGNORECASE");
+ regexModifiers.put('l', "LOCALE");
+ regexModifiers.put('m', "MULTILINE");
+ regexModifiers.put('s', "DOTALL");
+ regexModifiers.put('u', "UNICODE");
+ regexModifiers.put('x', "VERBOSE");
+
+ cliOptions.clear();
+ cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "python package name (convention: snake_case).")
+ .defaultValue("openapi_client"));
+ cliOptions.add(new CliOption(CodegenConstants.PROJECT_NAME, "python project name in setup.py (e.g. petstore-api)."));
+ cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, "python package version.")
+ .defaultValue("1.0.0"));
+ cliOptions.add(new CliOption(PACKAGE_URL, "python package URL."));
+ cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC)
+ .defaultValue(Boolean.TRUE.toString()));
+ cliOptions.add(new CliOption(CodegenConstants.SOURCECODEONLY_GENERATION, CodegenConstants.SOURCECODEONLY_GENERATION_DESC)
+ .defaultValue(Boolean.FALSE.toString()));
+ cliOptions.add(new CliOption(RECURSION_LIMIT, "Set the recursion limit. If not set, use the system default value."));
+
+ supportedLibraries.put("urllib3", "urllib3-based client");
+ supportedLibraries.put("asyncio", "asyncio-based client");
+ supportedLibraries.put("tornado", "tornado-based client (deprecated)");
+ CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use: asyncio, tornado (deprecated), urllib3");
+ libraryOption.setDefault(DEFAULT_LIBRARY);
+ cliOptions.add(libraryOption);
+ setLibrary(DEFAULT_LIBRARY);
+
+ // option to change how we process + set the data in the 'additionalProperties' keyword.
+ CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
+ CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
+ CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
+ Map disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
+ disallowAdditionalPropertiesIfNotPresentOpts.put("false",
+ "The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
+ disallowAdditionalPropertiesIfNotPresentOpts.put("true",
+ "Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.");
+ disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
+ cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
+ this.setDisallowAdditionalPropertiesIfNotPresent(true);
+ }
+
+ @Override
+ public void processOpts() {
+ this.setLegacyDiscriminatorBehavior(false);
+
+ super.processOpts();
+
+ if (StringUtils.isEmpty(System.getenv("PYTHON_POST_PROCESS_FILE"))) {
+ LOGGER.info("Environment variable PYTHON_POST_PROCESS_FILE not defined so the Python code may not be properly formatted. To define it, try 'export PYTHON_POST_PROCESS_FILE=\"/usr/local/bin/yapf -i\"' (Linux/Mac)");
+ LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).");
+ }
+
+ Boolean excludeTests = false;
+
+ if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
+ setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME));
+ }
+
+ if (additionalProperties.containsKey(CodegenConstants.PROJECT_NAME)) {
+ setProjectName((String) additionalProperties.get(CodegenConstants.PROJECT_NAME));
+ } else {
+ // default: set project based on package name
+ // e.g. petstore_api (package name) => petstore-api (project name)
+ setProjectName(packageName.replaceAll("_", "-"));
+ }
+
+ if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) {
+ setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION));
+ }
+
+ additionalProperties.put(CodegenConstants.PROJECT_NAME, projectName);
+ additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName);
+ additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion);
+
+ if (additionalProperties.containsKey(CodegenConstants.EXCLUDE_TESTS)) {
+ excludeTests = Boolean.valueOf(additionalProperties.get(CodegenConstants.EXCLUDE_TESTS).toString());
+ }
+
+ Boolean generateSourceCodeOnly = false;
+ if (additionalProperties.containsKey(CodegenConstants.SOURCECODEONLY_GENERATION)) {
+ generateSourceCodeOnly = Boolean.valueOf(additionalProperties.get(CodegenConstants.SOURCECODEONLY_GENERATION).toString());
+ }
+
+ if (generateSourceCodeOnly) {
+ // tests in /test
+ testFolder = packagePath() + File.separatorChar + testFolder;
+ // api/model docs in /docs
+ apiDocPath = packagePath() + File.separatorChar + apiDocPath;
+ modelDocPath = packagePath() + File.separatorChar + modelDocPath;
+ }
+ // make api and model doc path available in mustache template
+ additionalProperties.put("apiDocPath", apiDocPath);
+ additionalProperties.put("modelDocPath", modelDocPath);
+
+ if (additionalProperties.containsKey(PACKAGE_URL)) {
+ setPackageUrl((String) additionalProperties.get(PACKAGE_URL));
+ }
+
+ // check to see if setRecursionLimit is set and whether it's an integer
+ if (additionalProperties.containsKey(RECURSION_LIMIT)) {
+ try {
+ Integer.parseInt((String) additionalProperties.get(RECURSION_LIMIT));
+ } catch (NumberFormatException | NullPointerException e) {
+ throw new IllegalArgumentException("recursionLimit must be an integer, e.g. 2000.");
+ }
+ }
+
+ if (additionalProperties.containsKey(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP)) {
+ setUseOneOfDiscriminatorLookup(convertPropertyToBooleanAndWriteBack(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP));
+ } else {
+ additionalProperties.put(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, useOneOfDiscriminatorLookup);
+ }
+
+ String modelPath = packagePath() + File.separatorChar + modelPackage.replace('.', File.separatorChar);
+ String apiPath = packagePath() + File.separatorChar + apiPackage.replace('.', File.separatorChar);
+
+ String readmePath = "README.md";
+ String readmeTemplate = "README.mustache";
+ if (generateSourceCodeOnly) {
+ readmePath = packagePath() + "_" + readmePath;
+ readmeTemplate = "README_onlypackage.mustache";
+ }
+ supportingFiles.add(new SupportingFile(readmeTemplate, "", readmePath));
+
+ if (!generateSourceCodeOnly) {
+ supportingFiles.add(new SupportingFile("tox.mustache", "", "tox.ini"));
+ supportingFiles.add(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt"));
+ supportingFiles.add(new SupportingFile("requirements.mustache", "", "requirements.txt"));
+ supportingFiles.add(new SupportingFile("setup_cfg.mustache", "", "setup.cfg"));
+
+ supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
+ supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
+ supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml"));
+ supportingFiles.add(new SupportingFile("github-workflow.mustache", ".github/workflows", "python.yml"));
+ supportingFiles.add(new SupportingFile("gitlab-ci.mustache", "", ".gitlab-ci.yml"));
+ supportingFiles.add(new SupportingFile("setup.mustache", "", "setup.py"));
+ }
+ supportingFiles.add(new SupportingFile("configuration.mustache", packagePath(), "configuration.py"));
+ supportingFiles.add(new SupportingFile("__init__package.mustache", packagePath(), "__init__.py"));
+ supportingFiles.add(new SupportingFile("__init__model.mustache", modelPath, "__init__.py"));
+ supportingFiles.add(new SupportingFile("__init__api.mustache", apiPath, "__init__.py"));
+ // Generate the 'signing.py' module, but only if the 'HTTP signature' security scheme is specified in the OAS.
+ Map securitySchemeMap = openAPI != null ?
+ (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null;
+ List authMethods = fromSecurity(securitySchemeMap);
+ if (ProcessUtils.hasHttpSignatureMethods(authMethods)) {
+ supportingFiles.add(new SupportingFile("signing.mustache", packagePath(), "signing.py"));
+ }
+
+ // If the package name consists of dots(openapi.client), then we need to create the directory structure like openapi/client with __init__ files.
+ String[] packageNameSplits = packageName.split("\\.");
+ String currentPackagePath = "";
+ for (int i = 0; i < packageNameSplits.length - 1; i++) {
+ if (i > 0) {
+ currentPackagePath = currentPackagePath + File.separatorChar;
+ }
+ currentPackagePath = currentPackagePath + packageNameSplits[i];
+ supportingFiles.add(new SupportingFile("__init__.mustache", currentPackagePath, "__init__.py"));
+ }
+
+ supportingFiles.add(new SupportingFile("exceptions.mustache", packagePath(), "exceptions.py"));
+
+ if (Boolean.FALSE.equals(excludeTests)) {
+ supportingFiles.add(new SupportingFile("__init__.mustache", testFolder, "__init__.py"));
+ }
+
+ supportingFiles.add(new SupportingFile("api_client.mustache", packagePath(), "api_client.py"));
+
+ if ("asyncio".equals(getLibrary())) {
+ supportingFiles.add(new SupportingFile("asyncio/rest.mustache", packagePath(), "rest.py"));
+ additionalProperties.put("asyncio", "true");
+ } else if ("tornado".equals(getLibrary())) {
+ supportingFiles.add(new SupportingFile("tornado/rest.mustache", packagePath(), "rest.py"));
+ additionalProperties.put("tornado", "true");
+ } else {
+ supportingFiles.add(new SupportingFile("rest.mustache", packagePath(), "rest.py"));
+ }
+
+ modelPackage = this.packageName + "." + modelPackage;
+ apiPackage = this.packageName + "." + apiPackage;
+ }
+
+ public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) {
+ this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup;
+ }
+
+ public boolean getUseOneOfDiscriminatorLookup() {
+ return this.useOneOfDiscriminatorLookup;
+ }
+
+ @Override
+ public String toModelImport(String name) {
+ String modelImport;
+ if (StringUtils.startsWithAny(name, "import", "from")) {
+ modelImport = name;
+ } else {
+ modelImport = "from ";
+ if (!"".equals(modelPackage())) {
+ modelImport += modelPackage() + ".";
+ }
+ modelImport += toModelFilename(name) + " import " + name;
+ }
+ return modelImport;
+ }
+
+ @Override
+ public String getTypeDeclaration(Schema p) {
+ if (ModelUtils.isArraySchema(p)) {
+ ArraySchema ap = (ArraySchema) p;
+ Schema inner = ap.getItems();
+ return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
+ } else if (ModelUtils.isMapSchema(p)) {
+ Schema inner = getAdditionalProperties(p);
+
+ return getSchemaType(p) + "[str, " + getTypeDeclaration(inner) + "]";
+ }
+ return super.getTypeDeclaration(p);
+ }
+
+ /*
+ * Gets the pydantic type given a Codegen Parameter
+ *
+ * @param cp codegen parameter
+ * @param typingImports typing imports
+ * @param pydantic pydantic imports
+ * @param datetimeImports datetime imports
+ * @return pydantic type
+ *
+ */
+ private String getPydanticType(CodegenParameter cp,
+ Set typingImports,
+ Set pydanticImports,
+ Set datetimeImports,
+ Set modelImports) {
+ if (cp == null) {
+ // if codegen parameter (e.g. map/dict of undefined type) is null, default to string
+ LOGGER.warn("Codegen property is null (e.g. map/dict of undefined type). Default to string (StrictStr in Pydantic)");
+ pydanticImports.add("StrictStr");
+ return "StrictStr";
+ }
+
+ if (cp.isArray) {
+ typingImports.add("List");
+ return String.format(Locale.ROOT, "List[%s]", getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports));
+ } else if (cp.isMap) {
+ typingImports.add("Dict");
+ return String.format(Locale.ROOT, "Dict[str, %s]", getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports));
+ } else if (cp.isString || cp.isBinary || cp.isByteArray) {
+ if (cp.hasValidation) {
+ List fieldCustomization = new ArrayList<>();
+ // e.g. constr(regex=r'/[a-z]/i', strict=True)
+ fieldCustomization.add("strict=True");
+ if (cp.getMaxLength() != null) {
+ fieldCustomization.add("max_length=" + cp.getMaxLength());
+ }
+ if (cp.getMinLength() != null) {
+ fieldCustomization.add("min_length=" + cp.getMinLength());
+ }
+ if (cp.getPattern() != null) {
+ pydanticImports.add("validator");
+ // use validator instead as regex doesn't support flags, e.g. IGNORECASE
+ //fieldCustomization.add(String.format(Locale.ROOT, "regex=r'%s'", cp.getPattern()));
+ }
+ pydanticImports.add("constr");
+ return String.format(Locale.ROOT, "constr(%s)", StringUtils.join(fieldCustomization, ", "));
+ } else {
+ if ("password".equals(cp.getFormat())) { // TDOO avoid using format, use `is` boolean flag instead
+ pydanticImports.add("SecretStr");
+ return "SecretStr";
+ } else {
+ pydanticImports.add("StrictStr");
+ return "StrictStr";
+ }
+ }
+ } else if (cp.isNumber || cp.isFloat || cp.isDouble) {
+ if (cp.hasValidation) {
+ List fieldCustomization = new ArrayList<>();
+ // e.g. confloat(ge=10, le=100, strict=True)
+ fieldCustomization.add("strict=True");
+ if (cp.getMaximum() != null) {
+ if (cp.getExclusiveMaximum()) {
+ fieldCustomization.add("gt=" + cp.getMaximum());
+ } else {
+ fieldCustomization.add("ge=" + cp.getMaximum());
+ }
+ }
+ if (cp.getMinimum() != null) {
+ if (cp.getExclusiveMinimum()) {
+ fieldCustomization.add("lt=" + cp.getMinimum());
+ } else {
+ fieldCustomization.add("le=" + cp.getMinimum());
+ }
+ }
+ if (cp.getMultipleOf() != null) {
+ fieldCustomization.add("multiple_of=" + cp.getMultipleOf());
+ }
+
+ pydanticImports.add("confloat");
+ return String.format(Locale.ROOT, "%s(%s)", "confloat",
+ StringUtils.join(fieldCustomization, ", "));
+ } else {
+ pydanticImports.add("StrictFloat");
+ return "StrictFloat";
+ }
+ } else if (cp.isInteger || cp.isLong || cp.isShort || cp.isUnboundedInteger) {
+ if (cp.hasValidation) {
+ List fieldCustomization = new ArrayList<>();
+ // e.g. conint(ge=10, le=100, strict=True)
+ fieldCustomization.add("strict=True");
+ if (cp.getMaximum() != null) {
+ if (cp.getExclusiveMaximum()) {
+ fieldCustomization.add("gt=" + cp.getMaximum());
+ } else {
+ fieldCustomization.add("ge=" + cp.getMaximum());
+ }
+ }
+ if (cp.getMinimum() != null) {
+ if (cp.getExclusiveMinimum()) {
+ fieldCustomization.add("lt=" + cp.getMinimum());
+ } else {
+ fieldCustomization.add("le=" + cp.getMinimum());
+ }
+ }
+ if (cp.getMultipleOf() != null) {
+ fieldCustomization.add("multiple_of=" + cp.getMultipleOf());
+ }
+
+ pydanticImports.add("conint");
+ return String.format(Locale.ROOT, "%s(%s)", "conint",
+ StringUtils.join(fieldCustomization, ", "));
+
+ } else {
+ pydanticImports.add("StrictInt");
+ return "StrictInt";
+ }
+ /* comment out the following as byte/binary is a string at the moment (path to the file, e.g. "/var/tmp/a.gif")
+ } else if (cp.isBinary || cp.isByteArray) {
+ if (cp.hasValidation) {
+ List fieldCustomization = new ArrayList<>();
+ // e.g. conbytes(min_length=2, max_length=10)
+ fieldCustomization.add("strict=True");
+ if (cp.getMinLength() != null) {
+ fieldCustomization.add("min_length=" + cp.getMinLength());
+ }
+ if (cp.getMaxLength() != null) {
+ fieldCustomization.add("max_length=" + cp.getMaxLength());
+ }
+
+ pydanticImports.add("conbytes");
+ return String.format(Locale.ROOT, "%s(%s)", "conbytes", StringUtils.join(fieldCustomization, ", "));
+ } else {
+ // same as above which has validation
+ pydanticImports.add("StrictBytes");
+ return "StrictBytes";
+ }*/
+ } else if (cp.isBoolean) {
+ pydanticImports.add("StrictBool");
+ return "StrictBool";
+ } else if (cp.isDecimal) {
+ if (cp.hasValidation) {
+ List fieldCustomization = new ArrayList<>();
+ // e.g. condecimal(ge=10, le=100, strict=True)
+ fieldCustomization.add("strict=True");
+ if (cp.getMaximum() != null) {
+ if (cp.getExclusiveMaximum()) {
+ fieldCustomization.add("gt=" + cp.getMaximum());
+ } else {
+ fieldCustomization.add("ge=" + cp.getMaximum());
+ }
+ }
+ if (cp.getMinimum() != null) {
+ if (cp.getExclusiveMinimum()) {
+ fieldCustomization.add("lt=" + cp.getMinimum());
+ } else {
+ fieldCustomization.add("le=" + cp.getMinimum());
+ }
+ }
+ if (cp.getMultipleOf() != null) {
+ fieldCustomization.add("multiple_of=" + cp.getMultipleOf());
+ }
+ pydanticImports.add("condecimal");
+ return String.format(Locale.ROOT, "%s(%s)", "condecimal", StringUtils.join(fieldCustomization, ", "));
+ } else {
+ pydanticImports.add("condecimal");
+ return "condecimal()";
+ }
+ } else if (cp.getIsAnyType()) {
+ typingImports.add("Any");
+ return "Any";
+ } else if (cp.isDate || cp.isDateTime) {
+ if (cp.isDate) {
+ datetimeImports.add("date");
+ }
+ if (cp.isDateTime) {
+ datetimeImports.add("datetime");
+ }
+ return cp.dataType;
+ } else if (cp.isUuid) {
+ return cp.dataType;
+ } else if (cp.isFreeFormObject) { // type: object
+ typingImports.add("Dict");
+ typingImports.add("Any");
+ return "Dict[str, Any]";
+ } else if (!cp.isPrimitiveType) {
+ // add model prefix
+ hasModelsToImport = true;
+ modelImports.add(cp.dataType);
+ return cp.dataType;
+ } else if (cp.getContent() != null) {
+ LinkedHashMap contents = cp.getContent();
+ for (String key : contents.keySet()) {
+ CodegenMediaType cmt = contents.get(key);
+ // TODO process the first one only at the moment
+ if (cmt != null)
+ return getPydanticType(cmt.getSchema(), typingImports, pydanticImports, datetimeImports, modelImports);
+ }
+ throw new RuntimeException("Error! Failed to process getPydanticType when getting the content: " + cp);
+ } else {
+ throw new RuntimeException("Error! Codegen Parameter not yet supported in getPydanticType: " + cp);
+ }
+ }
+
+ /*
+ * Gets the pydantic type given a Codegen Property
+ *
+ * @param cp codegen property
+ * @param typingImports typing imports
+ * @param pydantic pydantic imports
+ * @param datetimeImports datetime imports
+ * @return pydantic type
+ *
+ */
+ private String getPydanticType(CodegenProperty cp,
+ Set typingImports,
+ Set pydanticImports,
+ Set datetimeImports,
+ Set modelImports) {
+ if (cp == null) {
+ // if codegen property (e.g. map/dict of undefined type) is null, default to string
+ LOGGER.warn("Codegen property is null (e.g. map/dict of undefined type). Default to string (StrictStr in Pydantic)");
+ pydanticImports.add("StrictStr");
+ return "StrictStr";
+ }
+
+ if (cp.isEnum) {
+ pydanticImports.add("validator");
+ }
+
+ /* comment out the following since Literal requires python 3.8
+ also need to put cp.isEnum check after isArray, isMap check
+ if (cp.isEnum) {
+ // use Literal for inline enum
+ typingImports.add("Literal");
+ List values = new ArrayList<>();
+ List> enumVars = (List>) cp.allowableValues.get("enumVars");
+ if (enumVars != null) {
+ for (Map enumVar : enumVars) {
+ values.add((String) enumVar.get("value"));
+ }
+ }
+ return String.format(Locale.ROOT, "%sEnum", cp.nameInCamelCase);
+ } else*/
+ if (cp.isArray) {
+ typingImports.add("List");
+ return String.format(Locale.ROOT, "List[%s]", getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports));
+ } else if (cp.isMap) {
+ typingImports.add("Dict");
+ return String.format(Locale.ROOT, "Dict[str, %s]", getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports));
+ } else if (cp.isString) {
+ if (cp.hasValidation) {
+ List fieldCustomization = new ArrayList<>();
+ // e.g. constr(regex=r'/[a-z]/i', strict=True)
+ fieldCustomization.add("strict=True");
+ if (cp.getMaxLength() != null) {
+ fieldCustomization.add("max_length=" + cp.getMaxLength());
+ }
+ if (cp.getMinLength() != null) {
+ fieldCustomization.add("min_length=" + cp.getMinLength());
+ }
+ if (cp.getPattern() != null) {
+ pydanticImports.add("validator");
+ // use validator instead as regex doesn't support flags, e.g. IGNORECASE
+ //fieldCustomization.add(Locale.ROOT, String.format(Locale.ROOT, "regex=r'%s'", cp.getPattern()));
+ }
+ pydanticImports.add("constr");
+ return String.format(Locale.ROOT, "constr(%s)", StringUtils.join(fieldCustomization, ", "));
+ } else {
+ if ("password".equals(cp.getFormat())) { // TDOO avoid using format, use `is` boolean flag instead
+ pydanticImports.add("SecretStr");
+ return "SecretStr";
+ } else {
+ pydanticImports.add("StrictStr");
+ return "StrictStr";
+ }
+ }
+ } else if (cp.isNumber || cp.isFloat || cp.isDouble) {
+ if (cp.hasValidation) {
+ List fieldCustomization = new ArrayList<>();
+ // e.g. confloat(ge=10, le=100, strict=True)
+ fieldCustomization.add("strict=True");
+ if (cp.getMaximum() != null) {
+ if (cp.getExclusiveMaximum()) {
+ fieldCustomization.add("lt=" + cp.getMaximum());
+ } else {
+ fieldCustomization.add("le=" + cp.getMaximum());
+ }
+ }
+ if (cp.getMinimum() != null) {
+ if (cp.getExclusiveMinimum()) {
+ fieldCustomization.add("gt=" + cp.getMinimum());
+ } else {
+ fieldCustomization.add("ge=" + cp.getMinimum());
+ }
+ }
+ if (cp.getMultipleOf() != null) {
+ fieldCustomization.add("multiple_of=" + cp.getMultipleOf());
+ }
+
+ pydanticImports.add("confloat");
+ return String.format(Locale.ROOT, "%s(%s)", "confloat",
+ StringUtils.join(fieldCustomization, ", "));
+ } else {
+ pydanticImports.add("StrictFloat");
+ return "StrictFloat";
+ }
+ } else if (cp.isInteger || cp.isLong || cp.isShort || cp.isUnboundedInteger) {
+ if (cp.hasValidation) {
+ List fieldCustomization = new ArrayList<>();
+ // e.g. conint(ge=10, le=100, strict=True)
+ fieldCustomization.add("strict=True");
+ if (cp.getMaximum() != null) {
+ if (cp.getExclusiveMaximum()) {
+ fieldCustomization.add("lt=" + cp.getMaximum());
+ } else {
+ fieldCustomization.add("le=" + cp.getMaximum());
+ }
+ }
+ if (cp.getMinimum() != null) {
+ if (cp.getExclusiveMinimum()) {
+ fieldCustomization.add("gt=" + cp.getMinimum());
+ } else {
+ fieldCustomization.add("ge=" + cp.getMinimum());
+ }
+ }
+ if (cp.getMultipleOf() != null) {
+ fieldCustomization.add("multiple_of=" + cp.getMultipleOf());
+ }
+
+ pydanticImports.add("conint");
+ return String.format(Locale.ROOT, "%s(%s)", "conint",
+ StringUtils.join(fieldCustomization, ", "));
+ } else {
+ pydanticImports.add("StrictInt");
+ return "StrictInt";
+ }
+ } else if (cp.isBinary || cp.isByteArray) {
+ if (cp.hasValidation) {
+ List fieldCustomization = new ArrayList<>();
+ // e.g. conbytes(min_length=2, max_length=10)
+ fieldCustomization.add("strict=True");
+ if (cp.getMinLength() != null) {
+ fieldCustomization.add("min_length=" + cp.getMinLength());
+ }
+ if (cp.getMaxLength() != null) {
+ fieldCustomization.add("max_length=" + cp.getMaxLength());
+ }
+ if (cp.getPattern() != null) {
+ pydanticImports.add("validator");
+ // use validator instead as regex doesn't support flags, e.g. IGNORECASE
+ //fieldCustomization.add(Locale.ROOT, String.format(Locale.ROOT, "regex=r'%s'", cp.getPattern()));
+ }
+
+ pydanticImports.add("conbytes");
+ return String.format(Locale.ROOT, "%s(%s)", "conbytes", StringUtils.join(fieldCustomization, ", "));
+ } else {
+ // same as above which has validation
+ pydanticImports.add("StrictBytes");
+ return "StrictBytes";
+ }
+ } else if (cp.isBoolean) {
+ pydanticImports.add("StrictBool");
+ return "StrictBool";
+ } else if (cp.isDecimal) {
+ if (cp.hasValidation) {
+ List fieldCustomization = new ArrayList<>();
+ // e.g. condecimal(ge=10, le=100, strict=True)
+ fieldCustomization.add("strict=True");
+ if (cp.getMaximum() != null) {
+ if (cp.getExclusiveMaximum()) {
+ fieldCustomization.add("gt=" + cp.getMaximum());
+ } else {
+ fieldCustomization.add("ge=" + cp.getMaximum());
+ }
+ }
+ if (cp.getMinimum() != null) {
+ if (cp.getExclusiveMinimum()) {
+ fieldCustomization.add("lt=" + cp.getMinimum());
+ } else {
+ fieldCustomization.add("le=" + cp.getMinimum());
+ }
+ }
+ if (cp.getMultipleOf() != null) {
+ fieldCustomization.add("multiple_of=" + cp.getMultipleOf());
+ }
+ pydanticImports.add("condecimal");
+ return String.format(Locale.ROOT, "%s(%s)", "condecimal", StringUtils.join(fieldCustomization, ", "));
+ } else {
+ pydanticImports.add("condecimal");
+ return "condecimal()";
+ }
+ } else if (cp.getIsAnyType()) {
+ typingImports.add("Any");
+ return "Any";
+ } else if (cp.isDate || cp.isDateTime) {
+ if (cp.isDate) {
+ datetimeImports.add("date");
+ }
+ if (cp.isDateTime) {
+ datetimeImports.add("datetime");
+ }
+ return cp.dataType;
+ } else if (cp.isUuid) {
+ return cp.dataType;
+ } else if (cp.isFreeFormObject) { // type: object
+ typingImports.add("Dict");
+ typingImports.add("Any");
+ return "Dict[str, Any]";
+ } else if (!cp.isPrimitiveType || cp.isModel) { // model
+ if (!cp.isCircularReference) {
+ // skip import if it's a circular reference
+ hasModelsToImport = true;
+ modelImports.add(cp.dataType);
+ }
+ return cp.dataType;
+ } else {
+ throw new RuntimeException("Error! Codegen Property not yet supported in getPydanticType: " + cp);
+ }
+ }
+
+ @Override
+ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) {
+ hasModelsToImport = false;
+ TreeSet typingImports = new TreeSet<>();
+ TreeSet pydanticImports = new TreeSet<>();
+ TreeSet datetimeImports = new TreeSet<>();
+ TreeSet modelImports = new TreeSet<>();
+
+ OperationMap objectMap = objs.getOperations();
+ List operations = objectMap.getOperation();
+ for (CodegenOperation operation : operations) {
+
+ List params = operation.allParams;
+ for (CodegenParameter param : params) {
+ String typing = getPydanticType(param, typingImports, pydanticImports, datetimeImports, modelImports);
+ List fields = new ArrayList<>();
+ String firstField = "";
+
+ if (!param.required) { //optional
+ firstField = "None";
+ typing = "Optional[" + typing + "]";
+ typingImports.add("Optional");
+ } else { // required
+ firstField = "...";
+ if (param.isNullable) {
+ typing = "Optional[" + typing + "]";
+ typingImports.add("Optional");
+ }
+ }
+
+ if (!StringUtils.isEmpty(param.description)) { // has description
+ fields.add(String.format(Locale.ROOT, "description=\"%s\"", param.description));
+ }
+
+ if (param.isArray && param.getUniqueItems()) { // a set
+ fields.add("unique_items=True");
+ }
+
+ /* TODO support example
+ if (!StringUtils.isEmpty(cp.getExample())) { // has example
+ fields.add(String.format(Locale.ROOT, "example=%s", cp.getExample()));
+ }*/
+
+ String fieldCustomization;
+ if ("None".equals(firstField)) {
+ fieldCustomization = null;
+ } else { // required field
+ fieldCustomization = firstField;
+ }
+
+ if (!fields.isEmpty()) {
+ if (fieldCustomization != null) {
+ fields.add(0, fieldCustomization);
+ }
+ pydanticImports.add("Field");
+ fieldCustomization = String.format(Locale.ROOT, "Field(%s)", StringUtils.join(fields, ", "));
+ } else {
+ fieldCustomization = "Field()";
+ }
+
+ if ("Field()".equals(fieldCustomization)) {
+ param.vendorExtensions.put("x-py-typing", typing);
+ } else {
+ param.vendorExtensions.put("x-py-typing", String.format(Locale.ROOT, "Annotated[%s, %s]", typing, fieldCustomization));
+ }
+ }
+
+ // update typing import for operation return type
+ if (!StringUtils.isEmpty(operation.returnType)) {
+ String typing = getPydanticType(operation.returnProperty, typingImports,
+ new TreeSet<>() /* skip pydantic import for return type */, datetimeImports, modelImports);
+ }
+
+ }
+
+ List> newImports = new ArrayList<>();
+
+ // need datetime import
+ if (!datetimeImports.isEmpty()) {
+ Map item = new HashMap<>();
+ item.put("import", String.format(Locale.ROOT, "from datetime import %s\n", StringUtils.join(datetimeImports, ", ")));
+ newImports.add(item);
+ }
+
+ // need pydantic imports
+ if (!pydanticImports.isEmpty()) {
+ Map item = new HashMap<>();
+ item.put("import", String.format(Locale.ROOT, "from pydantic import %s\n", StringUtils.join(pydanticImports, ", ")));
+ newImports.add(item);
+ }
+
+ // need typing imports
+ if (!typingImports.isEmpty()) {
+ Map item = new HashMap<>();
+ item.put("import", String.format(Locale.ROOT, "from typing import %s\n", StringUtils.join(typingImports, ", ")));
+ newImports.add(item);
+ }
+
+ // import models one by one
+ if (!modelImports.isEmpty()) {
+ for (String modelImport : modelImports) {
+ Map item = new HashMap<>();
+ item.put("import", "from " + packageName + ".models." + underscore(modelImport) + " import " + modelImport);
+ newImports.add(item);
+ }
+ }
+
+ /* TODO
+ // need models import
+ if (hasModelsToImport) {
+ Map item = new HashMap<>();
+ item.put("import", String.format(Locale.ROOT, "from %s import models", packageName));
+ newImports.add(item);
+ }
+
+ // models import
+ if (hasModelsToImport) {
+ Map item = new HashMap<>();
+ item.put("import", String.format(Locale.ROOT, "from %s import %s", modelPackage, StringUtils.join(modelImports, ", ")));
+ newImports.add(item);
+ }*/
+
+ // reset imports with newImports
+ objs.setImports(newImports);
+ return objs;
+ }
+
+ @Override
+ public Map postProcessAllModels(Map objs) {
+ final Map processed = super.postProcessAllModels(objs);
+ for (Map.Entry entry : processed.entrySet()) {
+ entry.setValue(postProcessModelsMap(entry.getValue()));
+ }
+
+ return processed;
+ }
+
+ private ModelsMap postProcessModelsMap(ModelsMap objs) {
+ // process enum in models
+ objs = postProcessModelsEnum(objs);
+
+ TreeSet typingImports = new TreeSet<>();
+ TreeSet pydanticImports = new TreeSet<>();
+ TreeSet datetimeImports = new TreeSet<>();
+ TreeSet modelImports = new TreeSet<>();
+
+ for (ModelMap m : objs.getModels()) {
+ List readOnlyFields = new ArrayList<>();
+ hasModelsToImport = false;
+ int property_count = 1;
+ typingImports.clear();
+ pydanticImports.clear();
+ datetimeImports.clear();
+
+ CodegenModel model = m.getModel();
+
+ // handle null type in oneOf
+ if (model.getComposedSchemas() != null && model.getComposedSchemas().getOneOf() != null
+ && !model.getComposedSchemas().getOneOf().isEmpty()) {
+ int index = 0;
+ List oneOfs = model.getComposedSchemas().getOneOf();
+ for (CodegenProperty oneOf : oneOfs) {
+ if ("none_type".equals(oneOf.dataType)) {
+ oneOfs.remove(index);
+ break; // return earlier assuming there's only 1 null type defined
+ }
+ index++;
+ }
+ }
+
+ List codegenProperties = null;
+ if (!model.oneOf.isEmpty()) { // oneOfValidationError
+ codegenProperties = model.getComposedSchemas().getOneOf();
+ typingImports.add("Any");
+ typingImports.add("List");
+ pydanticImports.add("Field");
+ pydanticImports.add("StrictStr");
+ pydanticImports.add("ValidationError");
+ pydanticImports.add("validator");
+ } else if (!model.anyOf.isEmpty()) { // anyOF
+ codegenProperties = model.getComposedSchemas().getAnyOf();
+ pydanticImports.add("Field");
+ pydanticImports.add("StrictStr");
+ pydanticImports.add("ValidationError");
+ pydanticImports.add("validator");
+ } else { // typical model
+ codegenProperties = model.vars;
+ }
+
+ //loop through properties/schemas to setup typing, pydantic
+ for (CodegenProperty cp : codegenProperties) {
+ String typing = getPydanticType(cp, typingImports, pydanticImports, datetimeImports, modelImports);
+ List fields = new ArrayList<>();
+ String firstField = "";
+
+ // is readOnly?
+ if (cp.isReadOnly) {
+ readOnlyFields.add(cp.name);
+ }
+
+ if (!cp.required) { //optional
+ firstField = "None";
+ typing = "Optional[" + typing + "]";
+ typingImports.add("Optional");
+ } else { // required
+ firstField = "...";
+ if (cp.isNullable) {
+ typing = "Optional[" + typing + "]";
+ typingImports.add("Optional");
+ }
+ }
+
+ // field
+ if (cp.baseName != null && !cp.baseName.equals(cp.name)) { // base name not the same as name
+ fields.add(String.format(Locale.ROOT, "alias=\"%s\"", cp.baseName));
+ }
+
+ if (!StringUtils.isEmpty(cp.description)) { // has description
+ fields.add(String.format(Locale.ROOT, "description=\"%s\"", cp.description));
+ }
+
+ if (cp.isArray && cp.getUniqueItems()) { // a set
+ fields.add("unique_items=True");
+ }
+
+ /* TODO review as example may break the build
+ if (!StringUtils.isEmpty(cp.getExample())) { // has example
+ fields.add(String.format(Locale.ROOT, "example=%s", cp.getExample()));
+ }*/
+
+ String fieldCustomization;
+ if ("None".equals(firstField)) {
+ if (cp.defaultValue == null) {
+ fieldCustomization = "None";
+ } else {
+ fieldCustomization = cp.defaultValue;
+ }
+ } else { // required field
+ fieldCustomization = firstField;
+ }
+
+ if (!fields.isEmpty()) {
+ fields.add(0, fieldCustomization);
+ pydanticImports.add("Field");
+ fieldCustomization = String.format(Locale.ROOT, "Field(%s)", StringUtils.join(fields, ", "));
+ }
+
+ cp.vendorExtensions.put("x-py-typing", typing + " = " + fieldCustomization);
+
+ // setup x-py-name for each oneOf/anyOf schema
+ if (!model.oneOf.isEmpty()) { // oneOf
+ cp.vendorExtensions.put("x-py-name", String.format(Locale.ROOT, "__oneof_schema_%d", property_count++));
+ } else if (!model.anyOf.isEmpty()) { // anyOf
+ cp.vendorExtensions.put("x-py-name", String.format(Locale.ROOT, "__anyof_schema_%d", property_count++));
+ }
+ }
+
+ if (!model.isEnum) {
+ pydanticImports.add("BaseModel");
+ }
+
+ // add parent model to import
+ if (!StringUtils.isEmpty(model.parent)) {
+ modelImports.add(model.parent);
+ }
+
+ // set enum type in extensions
+ if (model.isEnum) {
+ for (Map enumVars : (List>) model.getAllowableValues().get("enumVars")) {
+ if ((Boolean) enumVars.get("isString")) {
+ model.vendorExtensions.put("x-py-enum-type", "str");
+ } else {
+ model.vendorExtensions.put("x-py-enum-type", "int");
+ }
+ break;
+ }
+ }
+
+ // set the extensions if the key is absent
+ model.getVendorExtensions().putIfAbsent("x-py-typing-imports", typingImports);
+ model.getVendorExtensions().putIfAbsent("x-py-pydantic-imports", pydanticImports);
+ model.getVendorExtensions().putIfAbsent("x-py-datetime-imports", datetimeImports);
+ model.getVendorExtensions().putIfAbsent("x-py-readonly", readOnlyFields);
+
+ // import models one by one
+ if (!modelImports.isEmpty()) {
+ Set modelsToImport = new TreeSet<>();
+ for (String modelImport : modelImports) {
+ if (modelImport.equals(model.classname)) {
+ // skip self import
+ continue;
+ }
+ modelsToImport.add("from " + packageName + ".models." + underscore(modelImport) + " import " + modelImport);
+ }
+
+ model.getVendorExtensions().putIfAbsent("x-py-model-imports", modelsToImport);
+ }
+ }
+
+ return objs;
+ }
+
+ @Override
+ public void postProcessParameter(CodegenParameter parameter) {
+ postProcessPattern(parameter.pattern, parameter.vendorExtensions);
+ }
+
+ @Override
+ public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {
+ postProcessPattern(property.pattern, property.vendorExtensions);
+ }
+
+ /*
+ * The OpenAPI pattern spec follows the Perl convention and style of modifiers. Python
+ * does not support this in as natural a way so it needs to convert it. See
+ * https://docs.python.org/2/howto/regex.html#compilation-flags for details.
+ *
+ * @param pattern (the String pattern to convert from python to Perl convention)
+ * @param vendorExtensions (list of custom x-* properties for extra functionality-see https://swagger.io/docs/specification/openapi-extensions/)
+ * @return void
+ * @throws IllegalArgumentException if pattern does not follow the Perl /pattern/modifiers convention
+ *
+ * Includes fix for issue #6675
+ */
+ public void postProcessPattern(String pattern, Map vendorExtensions) {
+ if (pattern != null) {
+ int i = pattern.lastIndexOf('/');
+
+ // TOOD update the check below follow python convention
+ //Must follow Perl /pattern/modifiers convention
+ if (pattern.charAt(0) != '/' || i < 2) {
+ throw new IllegalArgumentException("Pattern must follow the Perl "
+ + "/pattern/modifiers convention. " + pattern + " is not valid.");
+ }
+
+ String regex = pattern.substring(1, i).replace("'", "\\'");
+ List modifiers = new ArrayList();
+
+ for (char c : pattern.substring(i).toCharArray()) {
+ if (regexModifiers.containsKey(c)) {
+ String modifier = regexModifiers.get(c);
+ modifiers.add(modifier);
+ }
+ }
+
+ vendorExtensions.put("x-regex", regex);
+ vendorExtensions.put("x-modifiers", modifiers);
+ }
+ }
+
+ @Override
+ public CodegenType getTag() {
+ return CodegenType.CLIENT;
+ }
+
+ @Override
+ public String getName() {
+ return "python-nextgen";
+ }
+
+ @Override
+ public String getHelp() {
+ return "Generates a Python client library.";
+ }
+
+
+ @Override
+ public String apiDocFileFolder() {
+ return (outputFolder + File.separator + apiDocPath);
+ }
+
+ @Override
+ public String modelDocFileFolder() {
+ return (outputFolder + File.separator + modelDocPath);
+ }
+
+ @Override
+ public String toModelDocFilename(String name) {
+ return toModelName(name);
+ }
+
+ @Override
+ public String toApiDocFilename(String name) {
+ return toApiName(name);
+ }
+
+ @Override
+ public String addRegularExpressionDelimiter(String pattern) {
+ if (StringUtils.isEmpty(pattern)) {
+ return pattern;
+ }
+
+ if (!pattern.matches("^/.*")) {
+ // Perform a negative lookbehind on each `/` to ensure that it is escaped.
+ return "/" + pattern.replaceAll("(?
+ * (PEP 0008) Python packages should also have short, all-lowercase names,
+ * although the use of underscores is discouraged.
+ *
+ * @param packageName Package name
+ * @return Python package name that conforms to PEP 0008
+ */
+ @SuppressWarnings("static-method")
+ public String generatePackageName(String packageName) {
+ return underscore(packageName.replaceAll("[^\\w]+", ""));
+ }
+
+ @Override
+ public String generatorLanguageVersion() {
+ return "3.7+";
+ }
+
+ @Override
+ protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) {
+ final Schema additionalProperties = getAdditionalProperties(schema);
+
+ if (additionalProperties != null) {
+ codegenModel.additionalPropertiesType = getSchemaType(additionalProperties);
+ }
+ }
+
+ @Override
+ public String toEnumVarName(String name, String datatype) {
+ if (name.length() == 0) {
+ return "EMPTY";
+ }
+
+ if (name.trim().length() == 0) {
+ return "SPACE_" + name.length();
+ }
+
+ // for symbol, e.g. $, #
+ if (getSymbolName(name) != null) {
+ return (getSymbolName(name)).toUpperCase(Locale.ROOT);
+ }
+
+ // number
+ if ("int".equals(datatype) || "float".equals(datatype)) {
+ String varName = name;
+ varName = varName.replaceAll("-", "MINUS_");
+ varName = varName.replaceAll("\\+", "PLUS_");
+ varName = varName.replaceAll("\\.", "_DOT_");
+ return "NUMBER_" + varName;
+ }
+
+ // string
+ String enumName = sanitizeName(underscore(name).toUpperCase(Locale.ROOT));
+ enumName = enumName.replaceFirst("^_", "");
+ enumName = enumName.replaceFirst("_$", "");
+
+ if (isReservedWord(enumName) || enumName.matches("\\d.*")) { // reserved word or starts with number
+ return escapeReservedWord(enumName);
+ } else {
+ return enumName;
+ }
+ }
+
+ @Override
+ public String toEnumValue(String value, String datatype) {
+ if ("int".equals(datatype) || "float".equals(datatype)) {
+ return value;
+ } else {
+ return "\'" + escapeText(value) + "\'";
+ }
+ }
+
+ @Override
+ public String toEnumDefaultValue(String value, String datatype) {
+ return "self::" + datatype + "_" + value;
+ }
+
+ /**
+ * checks if the data should be classified as "string" in enum
+ * e.g. double in C# needs to be double-quoted (e.g. "2.8") by treating it as a string
+ * In the future, we may rename this function to "isEnumString"
+ *
+ * @param dataType data type
+ * @return true if it's a enum string
+ */
+ @Override
+ public boolean isDataTypeString(String dataType) {
+ return "str".equals(dataType);
+ }
+
+ @Override
+ public String escapeReservedWord(String name) {
+ if (this.reservedWordsMappings().containsKey(name)) {
+ return this.reservedWordsMappings().get(name);
+ }
+ return "var_" + name;
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
index 92dcb24bbcd..b5bc56f2f8d 100644
--- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
+++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
@@ -98,6 +98,7 @@ org.openapitools.codegen.languages.PhpDataTransferClientCodegen
org.openapitools.codegen.languages.PowerShellClientCodegen
org.openapitools.codegen.languages.ProtobufSchemaCodegen
org.openapitools.codegen.languages.PythonLegacyClientCodegen
+org.openapitools.codegen.languages.PythonNextgenClientCodegen
org.openapitools.codegen.languages.PythonClientCodegen
org.openapitools.codegen.languages.PythonFastAPIServerCodegen
org.openapitools.codegen.languages.PythonPriorClientCodegen
diff --git a/modules/openapi-generator/src/main/resources/python-legacy/api_client.mustache b/modules/openapi-generator/src/main/resources/python-legacy/api_client.mustache
index de0ef4b9462..dd44bb31313 100644
--- a/modules/openapi-generator/src/main/resources/python-legacy/api_client.mustache
+++ b/modules/openapi-generator/src/main/resources/python-legacy/api_client.mustache
@@ -325,8 +325,8 @@ class ApiClient(object):
return [self.__deserialize(sub_data, sub_kls)
for sub_data in data]
- if klass.startswith('dict('):
- sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
+ if klass.startswith('dict['):
+ sub_kls = re.match(r'dict\[([^,]*), (.*)\]', klass).group(2)
return {k: self.__deserialize(v, sub_kls)
for k, v in six.iteritems(data)}
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/README.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/README.mustache
new file mode 100644
index 00000000000..ae4af162a14
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/README.mustache
@@ -0,0 +1,55 @@
+# {{{projectName}}}
+{{#appDescriptionWithNewLines}}
+{{{.}}}
+{{/appDescriptionWithNewLines}}
+
+This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: {{appVersion}}
+- Package version: {{packageVersion}}
+{{^hideGenerationTimestamp}}
+- Build date: {{generatedDate}}
+{{/hideGenerationTimestamp}}
+- Build package: {{generatorClass}}
+{{#infoUrl}}
+For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
+{{/infoUrl}}
+
+## Requirements.
+
+Python {{{generatorLanguageVersion}}}
+
+## Installation & Usage
+### pip install
+
+If the python package is hosted on a repository, you can install directly using:
+
+```sh
+pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git
+```
+(you may need to run `pip` with root permission: `sudo pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git`)
+
+Then import the package:
+```python
+import {{{packageName}}}
+```
+
+### Setuptools
+
+Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
+
+```sh
+python setup.py install --user
+```
+(or `sudo python setup.py install` to install the package for all users)
+
+Then import the package:
+```python
+import {{{packageName}}}
+```
+
+## Getting Started
+
+Please follow the [installation procedure](#installation--usage) and then run the following:
+
+{{> common_README }}
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/README_onlypackage.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/README_onlypackage.mustache
new file mode 100644
index 00000000000..d04bc051f1d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/README_onlypackage.mustache
@@ -0,0 +1,44 @@
+# {{{projectName}}}
+{{#appDescription}}
+{{{.}}}
+{{/appDescription}}
+
+The `{{packageName}}` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: {{appVersion}}
+- Package version: {{packageVersion}}
+{{^hideGenerationTimestamp}}
+- Build date: {{generatedDate}}
+{{/hideGenerationTimestamp}}
+- Build package: {{generatorClass}}
+{{#infoUrl}}
+For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
+{{/infoUrl}}
+
+## Requirements.
+
+Python {{{generatorLanguageVersion}}}
+
+## Installation & Usage
+
+This python library package is generated without supporting files like setup.py or requirements files
+
+To be able to use it, you will need these dependencies in your own package that uses this library:
+
+* urllib3 >= 1.25.3
+* python-dateutil
+{{#asyncio}}
+* aiohttp
+{{/asyncio}}
+{{#tornado}}
+* tornado>=4.2,<5
+{{/tornado}}
+* pydantic
+* aenum
+
+## Getting Started
+
+In your own code, to use this library to connect and interact with {{{projectName}}},
+you can run the following:
+
+{{> common_README }}
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/__init__.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/__init__.mustache
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/__init__api.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/__init__api.mustache
new file mode 100644
index 00000000000..c2232a92f4c
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/__init__api.mustache
@@ -0,0 +1,7 @@
+from __future__ import absolute_import
+
+# flake8: noqa
+
+# import apis into api package
+{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}}
+{{/apis}}{{/apiInfo}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/__init__model.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/__init__model.mustache
new file mode 100644
index 00000000000..56487fff6a4
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/__init__model.mustache
@@ -0,0 +1,13 @@
+# coding: utf-8
+
+# flake8: noqa
+{{>partial_header}}
+
+from __future__ import absolute_import
+
+# import models into model package
+{{#models}}
+{{#model}}
+from {{modelPackage}}.{{classFilename}} import {{classname}}
+{{/model}}
+{{/models}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/__init__package.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/__init__package.mustache
new file mode 100644
index 00000000000..f12543f1f63
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/__init__package.mustache
@@ -0,0 +1,32 @@
+# coding: utf-8
+
+# flake8: noqa
+
+{{>partial_header}}
+
+from __future__ import absolute_import
+
+__version__ = "{{packageVersion}}"
+
+# import apis into sdk package
+{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}}
+{{/apis}}{{/apiInfo}}
+# import ApiClient
+from {{packageName}}.api_client import ApiClient
+from {{packageName}}.configuration import Configuration
+from {{packageName}}.exceptions import OpenApiException
+from {{packageName}}.exceptions import ApiTypeError
+from {{packageName}}.exceptions import ApiValueError
+from {{packageName}}.exceptions import ApiKeyError
+from {{packageName}}.exceptions import ApiAttributeError
+from {{packageName}}.exceptions import ApiException
+# import models into sdk package
+{{#models}}
+{{#model}}
+from {{modelPackage}}.{{classFilename}} import {{classname}}
+{{/model}}
+{{/models}}
+{{#recursionLimit}}
+
+__import__('sys').setrecursionlimit({{{.}}})
+{{/recursionLimit}}
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/api.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/api.mustache
new file mode 100644
index 00000000000..21edf634bc2
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/api.mustache
@@ -0,0 +1,264 @@
+# coding: utf-8
+
+{{>partial_header}}
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+{{#imports}}
+{{import}}
+{{/imports}}
+
+from {{packageName}}.api_client import ApiClient
+from {{packageName}}.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+{{#operations}}
+class {{classname}}(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+{{#operation}}
+
+ @validate_arguments
+ def {{operationId}}(self, {{#allParams}}{{paramName}} : {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}}, {{/allParams}}**kwargs) -> {{{returnType}}}{{^returnType}}None{{/returnType}}: # noqa: E501
+ """{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
+
+{{#notes}}
+ {{{.}}} # noqa: E501
+{{/notes}}
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}async_req=True)
+ >>> result = thread.get()
+
+{{#allParams}}
+ :param {{paramName}}:{{#description}} {{{.}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}}
+ :type {{paramName}}: {{dataType}}{{#optional}}, optional{{/optional}}
+{{/allParams}}
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: {{returnType}}{{^returnType}}None{{/returnType}}
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.{{operationId}}_with_http_info({{#allParams}}{{paramName}}, {{/allParams}}**kwargs) # noqa: E501
+
+ @validate_arguments
+ def {{operationId}}_with_http_info(self, {{#allParams}}{{paramName}} : {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}}, {{/allParams}}**kwargs): # noqa: E501
+ """{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
+
+{{#notes}}
+ {{{.}}} # noqa: E501
+{{/notes}}
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.{{operationId}}_with_http_info({{#allParams}}{{paramName}}, {{/allParams}}async_req=True)
+ >>> result = thread.get()
+
+{{#allParams}}
+ :param {{paramName}}:{{#description}} {{{.}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}}
+ :type {{paramName}}: {{dataType}}{{#optional}}, optional{{/optional}}
+{{/allParams}}
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: {{#returnType}}tuple({{.}}, status_code(int), headers(HTTPHeaderDict)){{/returnType}}{{^returnType}}None{{/returnType}}
+ """
+
+ {{#servers.0}}
+ _hosts = [
+{{#servers}}
+ '{{{url}}}'{{^-last}},{{/-last}}
+{{/servers}}
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ {{/servers.0}}
+ _params = locals()
+
+ _all_params = [
+{{#allParams}}
+ '{{paramName}}'{{^-last}},{{/-last}}
+{{/allParams}}
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params{{#servers.0}} and _key != "_host_index"{{/servers.0}}:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method {{operationId}}" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+{{#pathParams}}
+ if _params['{{paramName}}']:
+ _path_params['{{baseName}}'] = _params['{{paramName}}']
+ {{#isArray}}
+ _collection_formats['{{baseName}}'] = '{{collectionFormat}}'
+ {{/isArray}}
+{{/pathParams}}
+
+ # process the query parameters
+ _query_params = []
+{{#queryParams}}
+ if _params.get('{{paramName}}') is not None: # noqa: E501
+ _query_params.append(('{{baseName}}', _params['{{paramName}}'])){{#isArray}}
+ _collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isArray}}
+{{/queryParams}}
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+{{#headerParams}}
+ if _params['{{paramName}}']:
+ _header_params['{{baseName}}'] = _params['{{paramName}}']{{#isArray}}
+ _collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isArray}}
+{{/headerParams}}
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+{{#formParams}}
+ if _params['{{paramName}}']:
+ {{^isFile}}
+ _form_params.append(('{{baseName}}', _params['{{paramName}}']))
+ {{/isFile}}
+ {{#isFile}}
+ _files['{{baseName}}'] = _params['{{paramName}}']
+ {{/isFile}}
+ {{#isArray}}
+ _collection_formats['{{baseName}}'] = '{{collectionFormat}}'
+ {{/isArray}}
+{{/formParams}}
+
+ # process the body parameter
+ _body_params = None
+{{#bodyParam}}
+ if _params['{{paramName}}']:
+ _body_params = _params['{{paramName}}']
+{{/bodyParam}}
+
+ {{#hasProduces}}
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}]) # noqa: E501
+
+ {{/hasProduces}}
+ {{#hasConsumes}}
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ [{{#consumes}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}}]))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ {{/hasConsumes}}
+ # authentication setting
+ _auth_settings = [{{#authMethods}}'{{name}}'{{^-last}}, {{/-last}}{{/authMethods}}] # noqa: E501
+
+ {{#returnType}}
+ {{#responses}}
+ {{#-first}}
+ _response_types_map = {
+ {{/-first}}
+ {{^isWildcard}}
+ '{{code}}': {{#dataType}}"{{.}}"{{/dataType}}{{^dataType}}None{{/dataType}},
+ {{/isWildcard}}
+ {{#-last}}
+ }
+ {{/-last}}
+ {{/responses}}
+ {{/returnType}}
+ {{^returnType}}
+ _response_types_map = {}
+ {{/returnType}}
+
+ return self.api_client.call_api(
+ '{{{path}}}', '{{httpMethod}}',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ {{#servers.0}}
+ _host=_host,
+ {{/servers.0}}
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+{{/operation}}
+{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/api_client.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/api_client.mustache
new file mode 100644
index 00000000000..cd3e619d5b0
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/api_client.mustache
@@ -0,0 +1,778 @@
+# coding: utf-8
+{{>partial_header}}
+from __future__ import absolute_import
+
+import atexit
+import datetime
+from dateutil.parser import parse
+import json
+import mimetypes
+from multiprocessing.pool import ThreadPool
+import os
+import re
+import tempfile
+
+from urllib.parse import quote
+{{#tornado}}
+import tornado.gen
+{{/tornado}}
+
+from {{packageName}}.configuration import Configuration
+import {{modelPackage}}
+from {{packageName}} import rest
+from {{packageName}}.exceptions import ApiValueError, ApiException
+
+
+class ApiClient(object):
+ """Generic API client for OpenAPI client library builds.
+
+ OpenAPI generic API client. This client handles the client-
+ server communication, and is invariant across implementations. Specifics of
+ the methods and models for each application are generated from the OpenAPI
+ templates.
+
+ NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+ Do not edit the class manually.
+
+ :param configuration: .Configuration object for this client
+ :param header_name: a header to pass when making calls to the API.
+ :param header_value: a header value to pass when making calls to
+ the API.
+ :param cookie: a cookie to include in the header when making calls
+ to the API
+ :param pool_threads: The number of threads to use for async requests
+ to the API. More threads means more concurrent API requests.
+ """
+
+ PRIMITIVE_TYPES = (float, bool, bytes, str, int)
+ NATIVE_TYPES_MAPPING = {
+ 'int': int,
+ 'long': int, # TODO remove as only py3 is supported?
+ 'float': float,
+ 'str': str,
+ 'bool': bool,
+ 'date': datetime.date,
+ 'datetime': datetime.datetime,
+ 'object': object,
+ }
+ _pool = None
+
+ def __init__(self, configuration=None, header_name=None, header_value=None,
+ cookie=None, pool_threads=1):
+ # use default configuraiton if none is provided
+ if configuration is None:
+ configuration = Configuration.get_default()
+ self.configuration = configuration
+ self.pool_threads = pool_threads
+
+ self.rest_client = rest.RESTClientObject(configuration)
+ self.default_headers = {}
+ if header_name is not None:
+ self.default_headers[header_name] = header_value
+ self.cookie = cookie
+ # Set default User-Agent.
+ self.user_agent = '{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/httpUserAgent}}'
+ self.client_side_validation = configuration.client_side_validation
+
+ {{#asyncio}}
+ async def __aenter__(self):
+ return self
+
+ async def __aexit__(self, exc_type, exc_value, traceback):
+ await self.close()
+ {{/asyncio}}
+ {{^asyncio}}
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_value, traceback):
+ self.close()
+ {{/asyncio}}
+
+ {{#asyncio}}async {{/asyncio}}def close(self):
+ {{#asyncio}}
+ await self.rest_client.close()
+ {{/asyncio}}
+ if self._pool:
+ self._pool.close()
+ self._pool.join()
+ self._pool = None
+ if hasattr(atexit, 'unregister'):
+ atexit.unregister(self.close)
+
+ @property
+ def pool(self):
+ """Create thread pool on first request
+ avoids instantiating unused threadpool for blocking clients.
+ """
+ if self._pool is None:
+ atexit.register(self.close)
+ self._pool = ThreadPool(self.pool_threads)
+ return self._pool
+
+ @property
+ def user_agent(self):
+ """User agent for this API client"""
+ return self.default_headers['User-Agent']
+
+ @user_agent.setter
+ def user_agent(self, value):
+ self.default_headers['User-Agent'] = value
+
+ def set_default_header(self, header_name, header_value):
+ self.default_headers[header_name] = header_value
+
+
+ _default = None
+
+ @classmethod
+ def get_default(cls):
+ """Return new instance of ApiClient.
+
+ This method returns newly created, based on default constructor,
+ object of ApiClient class or returns a copy of default
+ ApiClient.
+
+ :return: The ApiClient object.
+ """
+ if cls._default is None:
+ cls._default = ApiClient()
+ return cls._default
+
+ @classmethod
+ def set_default(cls, default):
+ """Set default instance of ApiClient.
+
+ It stores default ApiClient.
+
+ :param default: object of ApiClient.
+ """
+ cls._default = default
+
+ {{#tornado}}
+ @tornado.gen.coroutine
+ {{/tornado}}
+ {{#asyncio}}async {{/asyncio}}def __call_api(
+ self, resource_path, method, path_params=None,
+ query_params=None, header_params=None, body=None, post_params=None,
+ files=None, response_types_map=None, auth_settings=None,
+ _return_http_data_only=None, collection_formats=None,
+ _preload_content=True, _request_timeout=None, _host=None,
+ _request_auth=None):
+
+ config = self.configuration
+
+ # header parameters
+ header_params = header_params or {}
+ header_params.update(self.default_headers)
+ if self.cookie:
+ header_params['Cookie'] = self.cookie
+ if header_params:
+ header_params = self.sanitize_for_serialization(header_params)
+ header_params = dict(self.parameters_to_tuples(header_params,
+ collection_formats))
+
+ # path parameters
+ if path_params:
+ path_params = self.sanitize_for_serialization(path_params)
+ path_params = self.parameters_to_tuples(path_params,
+ collection_formats)
+ for k, v in path_params:
+ # specified safe chars, encode everything
+ resource_path = resource_path.replace(
+ '{%s}' % k,
+ quote(str(v), safe=config.safe_chars_for_path_param)
+ )
+
+ # post parameters
+ if post_params or files:
+ post_params = post_params if post_params else []
+ post_params = self.sanitize_for_serialization(post_params)
+ post_params = self.parameters_to_tuples(post_params,
+ collection_formats)
+ post_params.extend(self.files_parameters(files))
+
+ # auth setting
+ self.update_params_for_auth(
+ header_params, query_params, auth_settings,
+ resource_path, method, body,
+ request_auth=_request_auth)
+
+ # body
+ if body:
+ body = self.sanitize_for_serialization(body)
+
+ # request url
+ if _host is None:
+ url = self.configuration.host + resource_path
+ else:
+ # use server/host defined in path or operation instead
+ url = _host + resource_path
+
+ # query parameters
+ if query_params:
+ query_params = self.sanitize_for_serialization(query_params)
+ url_query = self.parameters_to_url_query(query_params,
+ collection_formats)
+ url += "?" + url_query
+
+ try:
+ # perform request and return response
+ response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request(
+ method, url,
+ query_params=query_params,
+ headers=header_params,
+ post_params=post_params, body=body,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout)
+ except ApiException as e:
+ if e.body:
+ e.body = e.body.decode('utf-8')
+ raise e
+
+ self.last_response = response_data
+
+ return_data = response_data
+
+ if not _preload_content:
+ {{^tornado}}
+ return return_data
+ {{/tornado}}
+ {{#tornado}}
+ raise tornado.gen.Return(return_data)
+ {{/tornado}}
+
+ response_type = response_types_map.get(str(response_data.status), None)
+
+ if response_type not in ["file", "bytes"]:
+ match = None
+ content_type = response_data.getheader('content-type')
+ if content_type is not None:
+ match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
+ encoding = match.group(1) if match else "utf-8"
+ response_data.data = response_data.data.decode(encoding)
+
+ # deserialize response data
+
+ if response_type:
+ return_data = self.deserialize(response_data, response_type)
+ else:
+ return_data = None
+
+{{^tornado}}
+ if _return_http_data_only:
+ return (return_data)
+ else:
+ return (return_data, response_data.status,
+ response_data.getheaders())
+{{/tornado}}
+{{#tornado}}
+ if _return_http_data_only:
+ raise tornado.gen.Return(return_data)
+ else:
+ raise tornado.gen.Return((return_data, response_data.status,
+ response_data.getheaders()))
+{{/tornado}}
+
+ def sanitize_for_serialization(self, obj):
+ """Builds a JSON POST object.
+
+ If obj is None, return None.
+ If obj is str, int, long, float, bool, return directly.
+ If obj is datetime.datetime, datetime.date
+ convert to string in iso8601 format.
+ If obj is list, sanitize each element in the list.
+ If obj is dict, return the dict.
+ If obj is OpenAPI model, return the properties dict.
+
+ :param obj: The data to serialize.
+ :return: The serialized form of data.
+ """
+ if obj is None:
+ return None
+ elif isinstance(obj, self.PRIMITIVE_TYPES):
+ return obj
+ elif isinstance(obj, list):
+ return [self.sanitize_for_serialization(sub_obj)
+ for sub_obj in obj]
+ elif isinstance(obj, tuple):
+ return tuple(self.sanitize_for_serialization(sub_obj)
+ for sub_obj in obj)
+ elif isinstance(obj, (datetime.datetime, datetime.date)):
+ return obj.isoformat()
+
+ if isinstance(obj, dict):
+ obj_dict = obj
+ else:
+ # Convert model obj to dict except
+ # attributes `openapi_types`, `attribute_map`
+ # and attributes which value is not None.
+ # Convert attribute name to json key in
+ # model definition for request.
+ obj_dict = obj.to_dict()
+
+ return {key: self.sanitize_for_serialization(val)
+ for key, val in obj_dict.items()}
+
+ def deserialize(self, response, response_type):
+ """Deserializes response into an object.
+
+ :param response: RESTResponse object to be deserialized.
+ :param response_type: class literal for
+ deserialized object, or string of class name.
+
+ :return: deserialized object.
+ """
+ # handle file downloading
+ # save response body into a tmp file and return the instance
+ if response_type == "file":
+ return self.__deserialize_file(response)
+
+ # fetch data from response object
+ try:
+ data = json.loads(response.data)
+ except ValueError:
+ data = response.data
+
+ return self.__deserialize(data, response_type)
+
+ def __deserialize(self, data, klass):
+ """Deserializes dict, list, str into an object.
+
+ :param data: dict, list or str.
+ :param klass: class literal, or string of class name.
+
+ :return: object.
+ """
+ if data is None:
+ return None
+
+ if type(klass) == str:
+ if klass.startswith('List['):
+ sub_kls = re.match(r'List\[(.*)]', klass).group(1)
+ return [self.__deserialize(sub_data, sub_kls)
+ for sub_data in data]
+
+ if klass.startswith('Dict['):
+ sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2)
+ return {k: self.__deserialize(v, sub_kls)
+ for k, v in data.items()}
+
+ # convert str to class
+ if klass in self.NATIVE_TYPES_MAPPING:
+ klass = self.NATIVE_TYPES_MAPPING[klass]
+ else:
+ klass = getattr({{modelPackage}}, klass)
+
+ if klass in self.PRIMITIVE_TYPES:
+ return self.__deserialize_primitive(data, klass)
+ elif klass == object:
+ return self.__deserialize_object(data)
+ elif klass == datetime.date:
+ return self.__deserialize_date(data)
+ elif klass == datetime.datetime:
+ return self.__deserialize_datetime(data)
+ else:
+ return self.__deserialize_model(data, klass)
+
+ def call_api(self, resource_path, method,
+ path_params=None, query_params=None, header_params=None,
+ body=None, post_params=None, files=None,
+ response_types_map=None, auth_settings=None,
+ async_req=None, _return_http_data_only=None,
+ collection_formats=None,_preload_content=True,
+ _request_timeout=None, _host=None, _request_auth=None):
+ """Makes the HTTP request (synchronous) and returns deserialized data.
+
+ To make an async_req request, set the async_req parameter.
+
+ :param resource_path: Path to method endpoint.
+ :param method: Method to call.
+ :param path_params: Path parameters in the url.
+ :param query_params: Query parameters in the url.
+ :param header_params: Header parameters to be
+ placed in the request header.
+ :param body: Request body.
+ :param post_params dict: Request post form parameters,
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
+ :param auth_settings list: Auth Settings names for the request.
+ :param response: Response data type.
+ :param files dict: key -> filename, value -> filepath,
+ for `multipart/form-data`.
+ :param async_req bool: execute request asynchronously
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :param collection_formats: dict of collection formats for path, query,
+ header, and post parameters.
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_token: dict, optional
+ :return:
+ If async_req parameter is True,
+ the request will be called asynchronously.
+ The method will return the request thread.
+ If parameter async_req is False or missing,
+ then the method will return the response directly.
+ """
+ if not async_req:
+ return self.__call_api(resource_path, method,
+ path_params, query_params, header_params,
+ body, post_params, files,
+ response_types_map, auth_settings,
+ _return_http_data_only, collection_formats,
+ _preload_content, _request_timeout, _host,
+ _request_auth)
+
+ return self.pool.apply_async(self.__call_api, (resource_path,
+ method, path_params,
+ query_params,
+ header_params, body,
+ post_params, files,
+ response_types_map,
+ auth_settings,
+ _return_http_data_only,
+ collection_formats,
+ _preload_content,
+ _request_timeout,
+ _host, _request_auth))
+
+ def request(self, method, url, query_params=None, headers=None,
+ post_params=None, body=None, _preload_content=True,
+ _request_timeout=None):
+ """Makes the HTTP request using RESTClient."""
+ if method == "GET":
+ return self.rest_client.get_request(url,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ headers=headers)
+ elif method == "HEAD":
+ return self.rest_client.head_request(url,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ headers=headers)
+ elif method == "OPTIONS":
+ return self.rest_client.options_request(url,
+ query_params=query_params,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout)
+ elif method == "POST":
+ return self.rest_client.post_request(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "PUT":
+ return self.rest_client.put_request(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "PATCH":
+ return self.rest_client.patch_request(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "DELETE":
+ return self.rest_client.delete_request(url,
+ query_params=query_params,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ else:
+ raise ApiValueError(
+ "http method must be `GET`, `HEAD`, `OPTIONS`,"
+ " `POST`, `PATCH`, `PUT` or `DELETE`."
+ )
+
+ def parameters_to_tuples(self, params, collection_formats):
+ """Get parameters as list of tuples, formatting collections.
+
+ :param params: Parameters as dict or list of two-tuples
+ :param dict collection_formats: Parameter collection formats
+ :return: Parameters as list of tuples, collections formatted
+ """
+ new_params = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == 'multi':
+ new_params.extend((k, value) for value in v)
+ else:
+ if collection_format == 'ssv':
+ delimiter = ' '
+ elif collection_format == 'tsv':
+ delimiter = '\t'
+ elif collection_format == 'pipes':
+ delimiter = '|'
+ else: # csv is the default
+ delimiter = ','
+ new_params.append(
+ (k, delimiter.join(str(value) for value in v)))
+ else:
+ new_params.append((k, v))
+ return new_params
+
+ def parameters_to_url_query(self, params, collection_formats):
+ """Get parameters as list of tuples, formatting collections.
+
+ :param params: Parameters as dict or list of two-tuples
+ :param dict collection_formats: Parameter collection formats
+ :return: URL query string (e.g. a=Hello%20World&b=123)
+ """
+ new_params = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == 'multi':
+ new_params.extend((k, value) for value in v)
+ else:
+ if collection_format == 'ssv':
+ delimiter = ' '
+ elif collection_format == 'tsv':
+ delimiter = '\t'
+ elif collection_format == 'pipes':
+ delimiter = '|'
+ else: # csv is the default
+ delimiter = ','
+ new_params.append(
+ (k, delimiter.join(quote(str(value)) for value in v)))
+ else:
+ new_params.append((k, v))
+
+ return "&".join(["=".join(item) for item in new_params])
+
+ def files_parameters(self, files=None):
+ """Builds form parameters.
+
+ :param files: File parameters.
+ :return: Form parameters with files.
+ """
+ params = []
+
+ if files:
+ for k, v in files.items():
+ if not v:
+ continue
+ file_names = v if type(v) is list else [v]
+ for n in file_names:
+ with open(n, 'rb') as f:
+ filename = os.path.basename(f.name)
+ filedata = f.read()
+ mimetype = (mimetypes.guess_type(filename)[0] or
+ 'application/octet-stream')
+ params.append(
+ tuple([k, tuple([filename, filedata, mimetype])]))
+
+ return params
+
+ def select_header_accept(self, accepts):
+ """Returns `Accept` based on an array of accepts provided.
+
+ :param accepts: List of headers.
+ :return: Accept (e.g. application/json).
+ """
+ if not accepts:
+ return
+
+ for accept in accepts:
+ if re.search('json', accept, re.IGNORECASE):
+ return accept
+
+ return accepts[0]
+
+ def select_header_content_type(self, content_types):
+ """Returns `Content-Type` based on an array of content_types provided.
+
+ :param content_types: List of content-types.
+ :return: Content-Type (e.g. application/json).
+ """
+ if not content_types:
+ return None
+
+ for content_type in content_types:
+ if re.search('json', content_type, re.IGNORECASE):
+ return content_type
+
+ return content_types[0]
+
+ def update_params_for_auth(self, headers, queries, auth_settings,
+ resource_path, method, body,
+ request_auth=None):
+ """Updates header and query params based on authentication setting.
+
+ :param headers: Header parameters dict to be updated.
+ :param queries: Query parameters tuple list to be updated.
+ :param auth_settings: Authentication setting identifiers list.
+ :resource_path: A string representation of the HTTP request resource path.
+ :method: A string representation of the HTTP request method.
+ :body: A object representing the body of the HTTP request.
+ The object type is the return value of sanitize_for_serialization().
+ :param request_auth: if set, the provided settings will
+ override the token in the configuration.
+ """
+ if not auth_settings:
+ return
+
+ if request_auth:
+ self._apply_auth_params(headers, queries,
+ resource_path, method, body,
+ request_auth)
+ return
+
+ for auth in auth_settings:
+ auth_setting = self.configuration.auth_settings().get(auth)
+ if auth_setting:
+ self._apply_auth_params(headers, queries,
+ resource_path, method, body,
+ auth_setting)
+
+ def _apply_auth_params(self, headers, queries,
+ resource_path, method, body,
+ auth_setting):
+ """Updates the request parameters based on a single auth_setting
+
+ :param headers: Header parameters dict to be updated.
+ :param queries: Query parameters tuple list to be updated.
+ :resource_path: A string representation of the HTTP request resource path.
+ :method: A string representation of the HTTP request method.
+ :body: A object representing the body of the HTTP request.
+ The object type is the return value of sanitize_for_serialization().
+ :param auth_setting: auth settings for the endpoint
+ """
+ if auth_setting['in'] == 'cookie':
+ headers['Cookie'] = auth_setting['value']
+ elif auth_setting['in'] == 'header':
+ if auth_setting['type'] != 'http-signature':
+ headers[auth_setting['key']] = auth_setting['value']
+ {{#hasHttpSignatureMethods}}
+ else:
+ # The HTTP signature scheme requires multiple HTTP headers
+ # that are calculated dynamically.
+ signing_info = self.configuration.signing_info
+ auth_headers = signing_info.get_http_signature_headers(
+ resource_path, method, headers, body, queries)
+ headers.update(auth_headers)
+ {{/hasHttpSignatureMethods}}
+ elif auth_setting['in'] == 'query':
+ queries.append((auth_setting['key'], auth_setting['value']))
+ else:
+ raise ApiValueError(
+ 'Authentication token must be in `query` or `header`'
+ )
+
+ def __deserialize_file(self, response):
+ """Deserializes body to file
+
+ Saves response body into a file in a temporary folder,
+ using the filename from the `Content-Disposition` header if provided.
+
+ :param response: RESTResponse.
+ :return: file path.
+ """
+ fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
+ os.close(fd)
+ os.remove(path)
+
+ content_disposition = response.getheader("Content-Disposition")
+ if content_disposition:
+ filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
+ content_disposition).group(1)
+ path = os.path.join(os.path.dirname(path), filename)
+
+ with open(path, "wb") as f:
+ f.write(response.data)
+
+ return path
+
+ def __deserialize_primitive(self, data, klass):
+ """Deserializes string to primitive type.
+
+ :param data: str.
+ :param klass: class literal.
+
+ :return: int, long, float, str, bool.
+ """
+ try:
+ return klass(data)
+ except UnicodeEncodeError:
+ return str(data)
+ except TypeError:
+ return data
+
+ def __deserialize_object(self, value):
+ """Return an original value.
+
+ :return: object.
+ """
+ return value
+
+ def __deserialize_date(self, string):
+ """Deserializes string to date.
+
+ :param string: str.
+ :return: date.
+ """
+ try:
+ return parse(string).date()
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason="Failed to parse `{0}` as date object".format(string)
+ )
+
+ def __deserialize_datetime(self, string):
+ """Deserializes string to datetime.
+
+ The string should be in iso8601 datetime format.
+
+ :param string: str.
+ :return: datetime.
+ """
+ try:
+ return parse(string)
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason=(
+ "Failed to parse `{0}` as datetime object"
+ .format(string)
+ )
+ )
+
+ def __deserialize_model(self, data, klass):
+ """Deserializes list or dict to model.
+
+ :param data: dict, list.
+ :param klass: class literal.
+ :return: model object.
+ """
+
+ return klass.from_dict(data)
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/api_doc.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/api_doc.mustache
new file mode 100644
index 00000000000..a9bc6e09bf1
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/api_doc.mustache
@@ -0,0 +1,76 @@
+# {{packageName}}.{{classname}}{{#description}}
+{{.}}{{/description}}
+
+All URIs are relative to *{{basePath}}*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}}
+{{/operation}}{{/operations}}
+
+{{#operations}}
+{{#operation}}
+# **{{{operationId}}}**
+> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{/required}}{{^required}}{{{paramName}}}={{{paramName}}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}})
+
+{{{summary}}}{{#notes}}
+
+{{{.}}}{{/notes}}
+
+### Example
+
+{{#hasAuthMethods}}
+{{#authMethods}}
+{{#isBasic}}
+{{#isBasicBasic}}
+* Basic Authentication ({{name}}):
+{{/isBasicBasic}}
+{{#isBasicBearer}}
+* Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} Authentication ({{name}}):
+{{/isBasicBearer}}
+{{/isBasic}}
+{{#isApiKey}}
+* Api Key Authentication ({{name}}):
+{{/isApiKey }}
+{{#isOAuth}}
+* OAuth Authentication ({{name}}):
+{{/isOAuth }}
+{{> api_doc_example }}
+{{/authMethods}}
+{{/hasAuthMethods}}
+{{^hasAuthMethods}}
+{{> api_doc_example }}
+{{/hasAuthMethods}}
+### Parameters
+{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
+{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}}
+{{/allParams}}
+
+### Return type
+
+{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}
+
+### Authorization
+
+{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}}
+
+### HTTP request headers
+
+ - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
+ - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}}
+
+{{#responses.0}}
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+{{#responses}}
+**{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}} {{/headers}}{{^headers.0}} - {{/headers.0}} |
+{{/responses}}
+{{/responses.0}}
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+{{/operation}}
+{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/api_doc_example.mustache
new file mode 100644
index 00000000000..59ceada0a8d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/api_doc_example.mustache
@@ -0,0 +1,33 @@
+```python
+from __future__ import print_function
+import time
+import os
+import {{{packageName}}}
+from {{{packageName}}}.rest import ApiException
+from pprint import pprint
+{{> python_doc_auth_partial}}
+# Enter a context with an instance of the API client
+{{#hasAuthMethods}}
+{{#asyncio}}async {{/asyncio}}with {{{packageName}}}.ApiClient(configuration) as api_client:
+{{/hasAuthMethods}}
+{{^hasAuthMethods}}
+{{#asyncio}}async {{/asyncio}}with {{{packageName}}}.ApiClient() as api_client:
+{{/hasAuthMethods}}
+ # Create an instance of the API class
+ api_instance = {{{packageName}}}.{{{classname}}}(api_client)
+ {{#allParams}}
+ {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
+ {{/allParams}}
+
+ try:
+ {{#summary}}
+ # {{{.}}}
+ {{/summary}}
+ {{#returnType}}api_response = {{/returnType}}{{#asyncio}}await {{/asyncio}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}})
+ {{#returnType}}
+ print("The response of {{classname}}->{{operationId}}:\n")
+ pprint(api_response)
+ {{/returnType}}
+ except Exception as e:
+ print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e)
+```
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/api_test.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/api_test.mustache
new file mode 100644
index 00000000000..a981c662a0d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/api_test.mustache
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+{{>partial_header}}
+
+from __future__ import absolute_import
+
+import unittest
+
+import {{packageName}}
+from {{apiPackage}}.{{classFilename}} import {{classname}} # noqa: E501
+from {{packageName}}.rest import ApiException
+
+
+class {{#operations}}Test{{classname}}(unittest.TestCase):
+ """{{classname}} unit test stubs"""
+
+ def setUp(self):
+ self.api = {{apiPackage}}.{{classFilename}}.{{classname}}() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ {{#operation}}
+ def test_{{operationId}}(self):
+ """Test case for {{{operationId}}}
+
+{{#summary}}
+ {{{.}}} # noqa: E501
+{{/summary}}
+ """
+ pass
+
+ {{/operation}}
+{{/operations}}
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/asyncio/rest.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/asyncio/rest.mustache
new file mode 100644
index 00000000000..98c811e513e
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/asyncio/rest.mustache
@@ -0,0 +1,241 @@
+# coding: utf-8
+
+{{>partial_header}}
+
+import io
+import json
+import logging
+import re
+import ssl
+
+import aiohttp
+from urllib.parse import urlencode, quote_plus
+
+from {{packageName}}.exceptions import ApiException, ApiValueError
+
+logger = logging.getLogger(__name__)
+
+
+class RESTResponse(io.IOBase):
+
+ def __init__(self, resp, data):
+ self.aiohttp_response = resp
+ self.status = resp.status
+ self.reason = resp.reason
+ self.data = data
+
+ def getheaders(self):
+ """Returns a CIMultiDictProxy of the response headers."""
+ return self.aiohttp_response.headers
+
+ def getheader(self, name, default=None):
+ """Returns a given response header."""
+ return self.aiohttp_response.headers.get(name, default)
+
+
+class RESTClientObject(object):
+
+ def __init__(self, configuration, pools_size=4, maxsize=None):
+
+ # maxsize is number of requests to host that are allowed in parallel
+ if maxsize is None:
+ maxsize = configuration.connection_pool_maxsize
+
+ ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert)
+ if configuration.cert_file:
+ ssl_context.load_cert_chain(
+ configuration.cert_file, keyfile=configuration.key_file
+ )
+
+ if not configuration.verify_ssl:
+ ssl_context.check_hostname = False
+ ssl_context.verify_mode = ssl.CERT_NONE
+
+ connector = aiohttp.TCPConnector(
+ limit=maxsize,
+ ssl=ssl_context
+ )
+
+ self.proxy = configuration.proxy
+ self.proxy_headers = configuration.proxy_headers
+
+ # https pool manager
+ self.pool_manager = aiohttp.ClientSession(
+ connector=connector,
+ trust_env=True
+ )
+
+ async def close(self):
+ await self.pool_manager.close()
+
+ async def request(self, method, url, query_params=None, headers=None,
+ body=None, post_params=None, _preload_content=True,
+ _request_timeout=None):
+ """Execute request
+
+ :param method: http request method
+ :param url: http request url
+ :param query_params: query parameters in the url
+ :param headers: http request headers
+ :param body: request json body, for `application/json`
+ :param post_params: request post parameters,
+ `application/x-www-form-urlencoded`
+ and `multipart/form-data`
+ :param _preload_content: this is a non-applicable field for
+ the AiohttpClient.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ """
+ method = method.upper()
+ assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
+ 'PATCH', 'OPTIONS']
+
+ if post_params and body:
+ raise ApiValueError(
+ "body parameter cannot be used with post_params parameter."
+ )
+
+ post_params = post_params or {}
+ headers = headers or {}
+ # url already contains the URL query string
+ # so reset query_params to empty dict
+ query_params = {}
+ timeout = _request_timeout or 5 * 60
+
+ if 'Content-Type' not in headers:
+ headers['Content-Type'] = 'application/json'
+
+ args = {
+ "method": method,
+ "url": url,
+ "timeout": timeout,
+ "headers": headers
+ }
+
+ if self.proxy:
+ args["proxy"] = self.proxy
+ if self.proxy_headers:
+ args["proxy_headers"] = self.proxy_headers
+
+ if query_params:
+ args["url"] += '?' + urlencode(query_params)
+
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
+ if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
+ if re.search('json', headers['Content-Type'], re.IGNORECASE):
+ if body is not None:
+ body = json.dumps(body)
+ args["data"] = body
+ elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
+ args["data"] = aiohttp.FormData(post_params)
+ elif headers['Content-Type'] == 'multipart/form-data':
+ # must del headers['Content-Type'], or the correct
+ # Content-Type which generated by aiohttp
+ del headers['Content-Type']
+ data = aiohttp.FormData()
+ for param in post_params:
+ k, v = param
+ if isinstance(v, tuple) and len(v) == 3:
+ data.add_field(k,
+ value=v[1],
+ filename=v[0],
+ content_type=v[2])
+ else:
+ data.add_field(k, v)
+ args["data"] = data
+
+ # Pass a `bytes` parameter directly in the body to support
+ # other content types than Json when `body` argument is provided
+ # in serialized form
+ elif isinstance(body, bytes):
+ args["data"] = body
+ else:
+ # Cannot generate the request from given parameters
+ msg = """Cannot prepare a request message for provided
+ arguments. Please check that your arguments match
+ declared content type."""
+ raise ApiException(status=0, reason=msg)
+
+ r = await self.pool_manager.request(**args)
+ if _preload_content:
+
+ data = await r.read()
+ r = RESTResponse(r, data)
+
+ # log response body
+ logger.debug("response body: %s", r.data)
+
+ if not 200 <= r.status <= 299:
+ raise ApiException(http_resp=r)
+
+ return r
+
+ async def get_request(self, url, headers=None, query_params=None,
+ _preload_content=True, _request_timeout=None):
+ return (await self.request("GET", url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params))
+
+ async def head_request(self, url, headers=None, query_params=None,
+ _preload_content=True, _request_timeout=None):
+ return (await self.request("HEAD", url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params))
+
+ async def options_request(self, url, headers=None, query_params=None,
+ post_params=None, body=None, _preload_content=True,
+ _request_timeout=None):
+ return (await self.request("OPTIONS", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body))
+
+ async def delete_request(self, url, headers=None, query_params=None, body=None,
+ _preload_content=True, _request_timeout=None):
+ return (await self.request("DELETE", url,
+ headers=headers,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body))
+
+ async def post_request(self, url, headers=None, query_params=None,
+ post_params=None, body=None, _preload_content=True,
+ _request_timeout=None):
+ return (await self.request("POST", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body))
+
+ async def put_request(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ return (await self.request("PUT", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body))
+
+ async def patch_request(self, url, headers=None, query_params=None,
+ post_params=None, body=None, _preload_content=True,
+ _request_timeout=None):
+ return (await self.request("PATCH", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body))
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/common_README.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/common_README.mustache
new file mode 100644
index 00000000000..e9182751f7d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/common_README.mustache
@@ -0,0 +1,83 @@
+```python
+from __future__ import print_function
+{{#apiInfo}}{{#apis}}{{#-last}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/-last}}{{/apis}}{{/apiInfo}}
+import time
+import {{{packageName}}}
+from {{{packageName}}}.rest import ApiException
+from pprint import pprint
+{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}
+{{> python_doc_auth_partial}}
+
+# Enter a context with an instance of the API client
+{{#asyncio}}async {{/asyncio}}with {{{packageName}}}.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = {{{packageName}}}.{{{classname}}}(api_client)
+ {{#allParams}}
+ {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
+ {{/allParams}}
+
+ try:
+ {{#summary}}
+ # {{{.}}}
+ {{/summary}}
+ {{#returnType}}api_response = {{/returnType}}{{#asyncio}}await {{/asyncio}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}})
+ {{#returnType}}
+ print("The response of {{classname}}->{{operationId}}:\n")
+ pprint(api_response)
+ {{/returnType}}
+ except ApiException as e:
+ print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e)
+{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *{{{basePath}}}*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}}
+{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
+
+## Documentation For Models
+
+{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md)
+{{/model}}{{/models}}
+
+## Documentation For Authorization
+
+{{^authMethods}}
+ All endpoints do not require authorization.
+{{/authMethods}}
+{{#authMethods}}
+{{#last}} Authentication schemes defined for the API:{{/last}}
+## {{{name}}}
+
+{{#isApiKey}}
+- **Type**: API key
+- **API key parameter name**: {{{keyParamName}}}
+- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
+{{/isApiKey}}
+{{#isBasic}}
+{{#isBasicBasic}}
+- **Type**: HTTP basic authentication
+{{/isBasicBasic}}
+{{#isBasicBearer}}
+- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}
+{{/isBasicBearer}}
+{{/isBasic}}
+{{#isOAuth}}
+- **Type**: OAuth
+- **Flow**: {{{flow}}}
+- **Authorization URL**: {{{authorizationUrl}}}
+- **Scopes**: {{^scopes}}N/A{{/scopes}}
+{{#scopes}} - **{{{scope}}}**: {{{description}}}
+{{/scopes}}
+{{/isOAuth}}
+
+{{/authMethods}}
+
+## Author
+
+{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}}
+{{/-last}}{{/apis}}{{/apiInfo}}
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/configuration.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/configuration.mustache
new file mode 100644
index 00000000000..4301c13e20f
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/configuration.mustache
@@ -0,0 +1,651 @@
+# coding: utf-8
+
+{{>partial_header}}
+
+from __future__ import absolute_import
+
+import copy
+import logging
+{{^asyncio}}
+import multiprocessing
+{{/asyncio}}
+import sys
+import urllib3
+
+import http.client as httplib
+from {{packageName}}.exceptions import ApiValueError
+
+
+JSON_SCHEMA_VALIDATION_KEYWORDS = {
+ 'multipleOf', 'maximum', 'exclusiveMaximum',
+ 'minimum', 'exclusiveMinimum', 'maxLength',
+ 'minLength', 'pattern', 'maxItems', 'minItems'
+}
+
+class Configuration(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+
+ Ref: https://openapi-generator.tech
+ Do not edit the class manually.
+
+ :param host: Base url.
+ :param api_key: Dict to store API key(s).
+ Each entry in the dict specifies an API key.
+ The dict key is the name of the security scheme in the OAS specification.
+ The dict value is the API key secret.
+ :param api_key_prefix: Dict to store API prefix (e.g. Bearer).
+ The dict key is the name of the security scheme in the OAS specification.
+ The dict value is an API key prefix when generating the auth data.
+ :param username: Username for HTTP basic authentication.
+ :param password: Password for HTTP basic authentication.
+ :param discard_unknown_keys: Boolean value indicating whether to discard
+ unknown properties. A server may send a response that includes additional
+ properties that are not known by the client in the following scenarios:
+ 1. The OpenAPI document is incomplete, i.e. it does not match the server
+ implementation.
+ 2. The client was generated using an older version of the OpenAPI document
+ and the server has been upgraded since then.
+ If a schema in the OpenAPI document defines the additionalProperties attribute,
+ then all undeclared properties received by the server are injected into the
+ additional properties map. In that case, there are undeclared properties, and
+ nothing to discard.
+ :param disabled_client_side_validations (string): Comma-separated list of
+ JSON schema validation keywords to disable JSON schema structural validation
+ rules. The following keywords may be specified: multipleOf, maximum,
+ exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern,
+ maxItems, minItems.
+ By default, the validation is performed for data generated locally by the client
+ and data received from the server, independent of any validation performed by
+ the server side. If the input data does not satisfy the JSON schema validation
+ rules specified in the OpenAPI document, an exception is raised.
+ If disabled_client_side_validations is set, structural validation is
+ disabled. This can be useful to troubleshoot data validation problem, such as
+ when the OpenAPI document validation rules do not match the actual API data
+ received by the server.
+{{#hasHttpSignatureMethods}}
+ :param signing_info: Configuration parameters for the HTTP signature security scheme.
+ Must be an instance of {{{packageName}}}.signing.HttpSigningConfiguration
+{{/hasHttpSignatureMethods}}
+ :param server_index: Index to servers configuration.
+ :param server_variables: Mapping with string values to replace variables in
+ templated server configuration. The validation of enums is performed for
+ variables with defined enum values before.
+ :param server_operation_index: Mapping from operation ID to an index to server
+ configuration.
+ :param server_operation_variables: Mapping from operation ID to a mapping with
+ string values to replace variables in templated server configuration.
+ The validation of enums is performed for variables with defined enum values before.
+ :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
+ in PEM format.
+
+{{#hasAuthMethods}}
+ :Example:
+{{#hasApiKeyMethods}}
+
+ API Key Authentication Example.
+ Given the following security scheme in the OpenAPI specification:
+ components:
+ securitySchemes:
+ cookieAuth: # name for the security scheme
+ type: apiKey
+ in: cookie
+ name: JSESSIONID # cookie name
+
+ You can programmatically set the cookie:
+
+conf = {{{packageName}}}.Configuration(
+ api_key={'cookieAuth': 'abc123'}
+ api_key_prefix={'cookieAuth': 'JSESSIONID'}
+)
+
+ The following cookie will be added to the HTTP request:
+ Cookie: JSESSIONID abc123
+{{/hasApiKeyMethods}}
+{{#hasHttpBasicMethods}}
+
+ HTTP Basic Authentication Example.
+ Given the following security scheme in the OpenAPI specification:
+ components:
+ securitySchemes:
+ http_basic_auth:
+ type: http
+ scheme: basic
+
+ Configure API client with HTTP basic authentication:
+
+conf = {{{packageName}}}.Configuration(
+ username='the-user',
+ password='the-password',
+)
+
+{{/hasHttpBasicMethods}}
+{{#hasHttpSignatureMethods}}
+
+ HTTP Signature Authentication Example.
+ Given the following security scheme in the OpenAPI specification:
+ components:
+ securitySchemes:
+ http_basic_auth:
+ type: http
+ scheme: signature
+
+ Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme,
+ sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time
+ of the signature to 5 minutes after the signature has been created.
+ Note you can use the constants defined in the {{{packageName}}}.signing module, and you can
+ also specify arbitrary HTTP headers to be included in the HTTP signature, except for the
+ 'Authorization' header, which is used to carry the signature.
+
+ One may be tempted to sign all headers by default, but in practice it rarely works.
+ This is because explicit proxies, transparent proxies, TLS termination endpoints or
+ load balancers may add/modify/remove headers. Include the HTTP headers that you know
+ are not going to be modified in transit.
+
+conf = {{{packageName}}}.Configuration(
+ signing_info = {{{packageName}}}.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'rsa.pem',
+ signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019,
+ signing_algorithm = {{{packageName}}}.signing.ALGORITHM_RSASSA_PSS,
+ signed_headers = [{{{packageName}}}.signing.HEADER_REQUEST_TARGET,
+ {{{packageName}}}.signing.HEADER_CREATED,
+ {{{packageName}}}.signing.HEADER_EXPIRES,
+ {{{packageName}}}.signing.HEADER_HOST,
+ {{{packageName}}}.signing.HEADER_DATE,
+ {{{packageName}}}.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+{{/hasHttpSignatureMethods}}
+{{/hasAuthMethods}}
+ """
+
+ _default = None
+
+ def __init__(self, host=None,
+ api_key=None, api_key_prefix=None,
+ username=None, password=None,
+ discard_unknown_keys=False,
+ disabled_client_side_validations="",
+{{#hasHttpSignatureMethods}}
+ signing_info=None,
+{{/hasHttpSignatureMethods}}
+ server_index=None, server_variables=None,
+ server_operation_index=None, server_operation_variables=None,
+ ssl_ca_cert=None,
+ ):
+ """Constructor
+ """
+ self._base_path = "{{{basePath}}}" if host is None else host
+ """Default Base url
+ """
+ self.server_index = 0 if server_index is None and host is None else server_index
+ self.server_operation_index = server_operation_index or {}
+ """Default server index
+ """
+ self.server_variables = server_variables or {}
+ self.server_operation_variables = server_operation_variables or {}
+ """Default server variables
+ """
+ self.temp_folder_path = None
+ """Temp file folder for downloading files
+ """
+ # Authentication Settings
+ self.api_key = {}
+ if api_key:
+ self.api_key = api_key
+ """dict to store API key(s)
+ """
+ self.api_key_prefix = {}
+ if api_key_prefix:
+ self.api_key_prefix = api_key_prefix
+ """dict to store API prefix (e.g. Bearer)
+ """
+ self.refresh_api_key_hook = None
+ """function hook to refresh API key if expired
+ """
+ self.username = username
+ """Username for HTTP basic authentication
+ """
+ self.password = password
+ """Password for HTTP basic authentication
+ """
+ self.discard_unknown_keys = discard_unknown_keys
+ self.disabled_client_side_validations = disabled_client_side_validations
+{{#hasHttpSignatureMethods}}
+ if signing_info is not None:
+ signing_info.host = host
+ self.signing_info = signing_info
+ """The HTTP signing configuration
+ """
+{{/hasHttpSignatureMethods}}
+{{#hasOAuthMethods}}
+ self.access_token = None
+ """access token for OAuth/Bearer
+ """
+{{/hasOAuthMethods}}
+{{^hasOAuthMethods}}
+{{#hasBearerMethods}}
+ self.access_token = None
+ """access token for OAuth/Bearer
+ """
+{{/hasBearerMethods}}
+{{/hasOAuthMethods}}
+ self.logger = {}
+ """Logging Settings
+ """
+ self.logger["package_logger"] = logging.getLogger("{{packageName}}")
+ self.logger["urllib3_logger"] = logging.getLogger("urllib3")
+ self.logger_format = '%(asctime)s %(levelname)s %(message)s'
+ """Log format
+ """
+ self.logger_stream_handler = None
+ """Log stream handler
+ """
+ self.logger_file_handler = None
+ """Log file handler
+ """
+ self.logger_file = None
+ """Debug file location
+ """
+ self.debug = False
+ """Debug switch
+ """
+
+ self.verify_ssl = True
+ """SSL/TLS verification
+ Set this to false to skip verifying SSL certificate when calling API
+ from https server.
+ """
+ self.ssl_ca_cert = ssl_ca_cert
+ """Set this to customize the certificate file to verify the peer.
+ """
+ self.cert_file = None
+ """client certificate file
+ """
+ self.key_file = None
+ """client key file
+ """
+ self.assert_hostname = None
+ """Set this to True/False to enable/disable SSL hostname verification.
+ """
+
+ {{#asyncio}}
+ self.connection_pool_maxsize = 100
+ """This value is passed to the aiohttp to limit simultaneous connections.
+ Default values is 100, None means no-limit.
+ """
+ {{/asyncio}}
+ {{^asyncio}}
+ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
+ """urllib3 connection pool's maximum number of connections saved
+ per pool. urllib3 uses 1 connection as default value, but this is
+ not the best value when you are making a lot of possibly parallel
+ requests to the same host, which is often the case here.
+ cpu_count * 5 is used as default value to increase performance.
+ """
+ {{/asyncio}}
+
+ self.proxy = None
+ """Proxy URL
+ """
+ self.proxy_headers = None
+ """Proxy headers
+ """
+ self.safe_chars_for_path_param = ''
+ """Safe chars for path_param
+ """
+ self.retries = None
+ """Adding retries to override urllib3 default value 3
+ """
+ # Enable client side validation
+ self.client_side_validation = True
+
+ self.socket_options = None
+ """Options to pass down to the underlying urllib3 socket
+ """
+
+ def __deepcopy__(self, memo):
+ cls = self.__class__
+ result = cls.__new__(cls)
+ memo[id(self)] = result
+ for k, v in self.__dict__.items():
+ if k not in ('logger', 'logger_file_handler'):
+ setattr(result, k, copy.deepcopy(v, memo))
+ # shallow copy of loggers
+ result.logger = copy.copy(self.logger)
+ # use setters to configure loggers
+ result.logger_file = self.logger_file
+ result.debug = self.debug
+ return result
+
+ def __setattr__(self, name, value):
+ object.__setattr__(self, name, value)
+ if name == 'disabled_client_side_validations':
+ s = set(filter(None, value.split(',')))
+ for v in s:
+ if v not in JSON_SCHEMA_VALIDATION_KEYWORDS:
+ raise ApiValueError(
+ "Invalid keyword: '{0}''".format(v))
+ self._disabled_client_side_validations = s
+{{#hasHttpSignatureMethods}}
+ if name == "signing_info" and value is not None:
+ # Ensure the host parameter from signing info is the same as
+ # Configuration.host.
+ value.host = self.host
+{{/hasHttpSignatureMethods}}
+
+ @classmethod
+ def set_default(cls, default):
+ """Set default instance of configuration.
+
+ It stores default configuration, which can be
+ returned by get_default_copy method.
+
+ :param default: object of Configuration
+ """
+ cls._default = default
+
+ @classmethod
+ def get_default_copy(cls):
+ """Deprecated. Please use `get_default` instead.
+
+ Deprecated. Please use `get_default` instead.
+
+ :return: The configuration object.
+ """
+ return cls.get_default()
+
+ @classmethod
+ def get_default(cls):
+ """Return the default configuration.
+
+ This method returns newly created, based on default constructor,
+ object of Configuration class or returns a copy of default
+ configuration.
+
+ :return: The configuration object.
+ """
+ if cls._default is None:
+ cls._default = Configuration()
+ return cls._default
+
+ @property
+ def logger_file(self):
+ """The logger file.
+
+ If the logger_file is None, then add stream handler and remove file
+ handler. Otherwise, add file handler and remove stream handler.
+
+ :param value: The logger_file path.
+ :type: str
+ """
+ return self.__logger_file
+
+ @logger_file.setter
+ def logger_file(self, value):
+ """The logger file.
+
+ If the logger_file is None, then add stream handler and remove file
+ handler. Otherwise, add file handler and remove stream handler.
+
+ :param value: The logger_file path.
+ :type: str
+ """
+ self.__logger_file = value
+ if self.__logger_file:
+ # If set logging file,
+ # then add file handler and remove stream handler.
+ self.logger_file_handler = logging.FileHandler(self.__logger_file)
+ self.logger_file_handler.setFormatter(self.logger_formatter)
+ for _, logger in self.logger.items():
+ logger.addHandler(self.logger_file_handler)
+
+ @property
+ def debug(self):
+ """Debug status
+
+ :param value: The debug status, True or False.
+ :type: bool
+ """
+ return self.__debug
+
+ @debug.setter
+ def debug(self, value):
+ """Debug status
+
+ :param value: The debug status, True or False.
+ :type: bool
+ """
+ self.__debug = value
+ if self.__debug:
+ # if debug status is True, turn on debug logging
+ for _, logger in self.logger.items():
+ logger.setLevel(logging.DEBUG)
+ # turn on httplib debug
+ httplib.HTTPConnection.debuglevel = 1
+ else:
+ # if debug status is False, turn off debug logging,
+ # setting log level to default `logging.WARNING`
+ for _, logger in self.logger.items():
+ logger.setLevel(logging.WARNING)
+ # turn off httplib debug
+ httplib.HTTPConnection.debuglevel = 0
+
+ @property
+ def logger_format(self):
+ """The logger format.
+
+ The logger_formatter will be updated when sets logger_format.
+
+ :param value: The format string.
+ :type: str
+ """
+ return self.__logger_format
+
+ @logger_format.setter
+ def logger_format(self, value):
+ """The logger format.
+
+ The logger_formatter will be updated when sets logger_format.
+
+ :param value: The format string.
+ :type: str
+ """
+ self.__logger_format = value
+ self.logger_formatter = logging.Formatter(self.__logger_format)
+
+ def get_api_key_with_prefix(self, identifier, alias=None):
+ """Gets API key (with prefix if set).
+
+ :param identifier: The identifier of apiKey.
+ :param alias: The alternative identifier of apiKey.
+ :return: The token for api key authentication.
+ """
+ if self.refresh_api_key_hook is not None:
+ self.refresh_api_key_hook(self)
+ key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
+ if key:
+ prefix = self.api_key_prefix.get(identifier)
+ if prefix:
+ return "%s %s" % (prefix, key)
+ else:
+ return key
+
+ def get_basic_auth_token(self):
+ """Gets HTTP basic authentication header (string).
+
+ :return: The token for basic HTTP authentication.
+ """
+ username = ""
+ if self.username is not None:
+ username = self.username
+ password = ""
+ if self.password is not None:
+ password = self.password
+ return urllib3.util.make_headers(
+ basic_auth=username + ':' + password
+ ).get('authorization')
+
+ def auth_settings(self):
+ """Gets Auth Settings dict for api client.
+
+ :return: The Auth Settings information dict.
+ """
+ auth = {}
+{{#authMethods}}
+{{#isApiKey}}
+ if '{{name}}' in self.api_key{{#vendorExtensions.x-auth-id-alias}} or '{{.}}' in self.api_key{{/vendorExtensions.x-auth-id-alias}}:
+ auth['{{name}}'] = {
+ 'type': 'api_key',
+ 'in': {{#isKeyInCookie}}'cookie'{{/isKeyInCookie}}{{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}},
+ 'key': '{{keyParamName}}',
+ 'value': self.get_api_key_with_prefix(
+ '{{name}}',{{#vendorExtensions.x-auth-id-alias}}
+ alias='{{.}}',{{/vendorExtensions.x-auth-id-alias}}
+ ),
+ }
+{{/isApiKey}}
+{{#isBasic}}
+ {{#isBasicBasic}}
+ if self.username is not None and self.password is not None:
+ auth['{{name}}'] = {
+ 'type': 'basic',
+ 'in': 'header',
+ 'key': 'Authorization',
+ 'value': self.get_basic_auth_token()
+ }
+ {{/isBasicBasic}}
+ {{#isBasicBearer}}
+ if self.access_token is not None:
+ auth['{{name}}'] = {
+ 'type': 'bearer',
+ 'in': 'header',
+ {{#bearerFormat}}
+ 'format': '{{{.}}}',
+ {{/bearerFormat}}
+ 'key': 'Authorization',
+ 'value': 'Bearer ' + self.access_token
+ }
+ {{/isBasicBearer}}
+ {{#isHttpSignature}}
+ if self.signing_info is not None:
+ auth['{{name}}'] = {
+ 'type': 'http-signature',
+ 'in': 'header',
+ 'key': 'Authorization',
+ 'value': None # Signature headers are calculated for every HTTP request
+ }
+ {{/isHttpSignature}}
+{{/isBasic}}
+{{#isOAuth}}
+ if self.access_token is not None:
+ auth['{{name}}'] = {
+ 'type': 'oauth2',
+ 'in': 'header',
+ 'key': 'Authorization',
+ 'value': 'Bearer ' + self.access_token
+ }
+{{/isOAuth}}
+{{/authMethods}}
+ return auth
+
+ def to_debug_report(self):
+ """Gets the essential information for debugging.
+
+ :return: The report for debugging.
+ """
+ return "Python SDK Debug Report:\n"\
+ "OS: {env}\n"\
+ "Python Version: {pyversion}\n"\
+ "Version of the API: {{version}}\n"\
+ "SDK Package Version: {{packageVersion}}".\
+ format(env=sys.platform, pyversion=sys.version)
+
+ def get_host_settings(self):
+ """Gets an array of host settings
+
+ :return: An array of host settings
+ """
+ return [
+ {{#servers}}
+ {
+ 'url': "{{{url}}}",
+ 'description': "{{{description}}}{{^description}}No description provided{{/description}}",
+ {{#variables}}
+ {{#-first}}
+ 'variables': {
+ {{/-first}}
+ '{{{name}}}': {
+ 'description': "{{{description}}}{{^description}}No description provided{{/description}}",
+ 'default_value': "{{{defaultValue}}}",
+ {{#enumValues}}
+ {{#-first}}
+ 'enum_values': [
+ {{/-first}}
+ "{{{.}}}"{{^-last}},{{/-last}}
+ {{#-last}}
+ ]
+ {{/-last}}
+ {{/enumValues}}
+ }{{^-last}},{{/-last}}
+ {{#-last}}
+ }
+ {{/-last}}
+ {{/variables}}
+ }{{^-last}},{{/-last}}
+ {{/servers}}
+ ]
+
+ def get_host_from_settings(self, index, variables=None, servers=None):
+ """Gets host URL based on the index and variables
+ :param index: array index of the host settings
+ :param variables: hash of variable and the corresponding value
+ :param servers: an array of host settings or None
+ :return: URL based on host settings
+ """
+ if index is None:
+ return self._base_path
+
+ variables = {} if variables is None else variables
+ servers = self.get_host_settings() if servers is None else servers
+
+ try:
+ server = servers[index]
+ except IndexError:
+ raise ValueError(
+ "Invalid index {0} when selecting the host settings. "
+ "Must be less than {1}".format(index, len(servers)))
+
+ url = server['url']
+
+ # go through variables and replace placeholders
+ for variable_name, variable in server.get('variables', {}).items():
+ used_value = variables.get(
+ variable_name, variable['default_value'])
+
+ if 'enum_values' in variable \
+ and used_value not in variable['enum_values']:
+ raise ValueError(
+ "The variable `{0}` in the host URL has invalid value "
+ "{1}. Must be {2}.".format(
+ variable_name, variables[variable_name],
+ variable['enum_values']))
+
+ url = url.replace("{" + variable_name + "}", used_value)
+
+ return url
+
+ @property
+ def host(self):
+ """Return generated host."""
+ return self.get_host_from_settings(self.server_index, variables=self.server_variables)
+
+ @host.setter
+ def host(self, value):
+ """Fix base path."""
+ self._base_path = value
+ self.server_index = None
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/exceptions.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/exceptions.mustache
new file mode 100644
index 00000000000..b1cecfa8b6b
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/exceptions.mustache
@@ -0,0 +1,152 @@
+# coding: utf-8
+
+{{>partial_header}}
+
+class OpenApiException(Exception):
+ """The base exception class for all OpenAPIExceptions"""
+
+
+class ApiTypeError(OpenApiException, TypeError):
+ def __init__(self, msg, path_to_item=None, valid_classes=None,
+ key_type=None):
+ """ Raises an exception for TypeErrors
+
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (list): a list of keys an indices to get to the
+ current_item
+ None if unset
+ valid_classes (tuple): the primitive classes that current item
+ should be an instance of
+ None if unset
+ key_type (bool): False if our value is a value in a dict
+ True if it is a key in a dict
+ False if our item is an item in a list
+ None if unset
+ """
+ self.path_to_item = path_to_item
+ self.valid_classes = valid_classes
+ self.key_type = key_type
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiTypeError, self).__init__(full_msg)
+
+
+class ApiValueError(OpenApiException, ValueError):
+ def __init__(self, msg, path_to_item=None):
+ """
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (list) the path to the exception in the
+ received_data dict. None if unset
+ """
+
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiValueError, self).__init__(full_msg)
+
+
+class ApiAttributeError(OpenApiException, AttributeError):
+ def __init__(self, msg, path_to_item=None):
+ """
+ Raised when an attribute reference or assignment fails.
+
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (None/list) the path to the exception in the
+ received_data dict
+ """
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiAttributeError, self).__init__(full_msg)
+
+
+class ApiKeyError(OpenApiException, KeyError):
+ def __init__(self, msg, path_to_item=None):
+ """
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (None/list) the path to the exception in the
+ received_data dict
+ """
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiKeyError, self).__init__(full_msg)
+
+
+class ApiException(OpenApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ if http_resp:
+ self.status = http_resp.status
+ self.reason = http_resp.reason
+ self.body = http_resp.data
+ self.headers = http_resp.getheaders()
+ else:
+ self.status = status
+ self.reason = reason
+ self.body = None
+ self.headers = None
+
+ def __str__(self):
+ """Custom error messages for exception"""
+ error_message = "({0})\n"\
+ "Reason: {1}\n".format(self.status, self.reason)
+ if self.headers:
+ error_message += "HTTP response headers: {0}\n".format(
+ self.headers)
+
+ if self.body:
+ error_message += "HTTP response body: {0}\n".format(self.body)
+
+ return error_message
+
+
+class NotFoundException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(NotFoundException, self).__init__(status, reason, http_resp)
+
+
+class UnauthorizedException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(UnauthorizedException, self).__init__(status, reason, http_resp)
+
+
+class ForbiddenException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(ForbiddenException, self).__init__(status, reason, http_resp)
+
+
+class ServiceException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(ServiceException, self).__init__(status, reason, http_resp)
+
+
+def render_path(path_to_item):
+ """Returns a string representation of a path"""
+ result = ""
+ for pth in path_to_item:
+ if isinstance(pth, int):
+ result += "[{0}]".format(pth)
+ else:
+ result += "['{0}']".format(pth)
+ return result
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/git_push.sh.mustache
new file mode 100755
index 00000000000..0e3776ae6dd
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/git_push.sh.mustache
@@ -0,0 +1,57 @@
+#!/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-petstore-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="{{{gitHost}}}"
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
+fi
+
+if [ "$git_user_id" = "" ]; then
+ git_user_id="{{{gitUserId}}}"
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+ git_repo_id="{{{gitRepoId}}}"
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+ release_note="{{{releaseNote}}}"
+ 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/modules/openapi-generator/src/main/resources/python-nextgen/github-workflow.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/github-workflow.mustache
new file mode 100644
index 00000000000..2698fdd76e5
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/github-workflow.mustache
@@ -0,0 +1,38 @@
+# NOTE: This file is auto generated by OpenAPI Generator.
+# URL: https://openapi-generator.tech
+#
+# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
+
+name: {{packageName}} Python package
+{{=<% %>=}}
+
+on: [push, pull_request]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: ["3.7", "3.8", "3.9", "3.10"]
+
+ steps:s
+ - uses: actions/checkout@v3
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}s
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install flake8 pytest
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+ - name: Lint with flake8
+ run: |
+ # stop the build if there are Python syntax errors or undefined names
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
+ - name: Test with pytest
+ run: |
+ pytest
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/gitignore.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/gitignore.mustache
new file mode 100644
index 00000000000..43995bd42fa
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/gitignore.mustache
@@ -0,0 +1,66 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+.hypothesis/
+venv/
+.venv/
+.python-version
+.pytest_cache
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+#Ipython Notebook
+.ipynb_checkpoints
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/gitlab-ci.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/gitlab-ci.mustache
new file mode 100644
index 00000000000..0bb48fd6d8c
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/gitlab-ci.mustache
@@ -0,0 +1,25 @@
+# NOTE: This file is auto generated by OpenAPI Generator.
+# URL: https://openapi-generator.tech
+#
+# ref: https://docs.gitlab.com/ee/ci/README.html
+# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
+
+stages:
+ - test
+
+.pytest:
+ stage: test
+ script:
+ - pip install -r requirements.txt
+ - pip install -r test-requirements.txt
+ - pytest --cov={{{packageName}}}
+
+pytest-3.7:
+ extends: .pytest
+ image: python:3.7-alpine
+pytest-3.8:
+ extends: .pytest
+ image: python:3.8-alpine
+pytest-3.9:
+ extends: .pytest
+ image: python:3.9-alpine
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/model.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/model.mustache
new file mode 100644
index 00000000000..84792dde195
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/model.mustache
@@ -0,0 +1,14 @@
+# coding: utf-8
+
+{{>partial_header}}
+
+{{#models}}
+{{#model}}
+{{#isEnum}}
+{{>model_enum}}
+{{/isEnum}}
+{{^isEnum}}
+{{#oneOf}}{{#-first}}{{>model_oneof}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>model_anyof}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>model_generic}}{{/anyOf}}{{/oneOf}}
+{{/isEnum}}
+{{/model}}
+{{/models}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/model_anyof.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/model_anyof.mustache
new file mode 100644
index 00000000000..9149f15fd51
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/model_anyof.mustache
@@ -0,0 +1,95 @@
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+{{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}}
+{{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}}
+{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}}
+{{#vendorExtensions.x-py-model-imports}}
+{{{.}}}
+{{/vendorExtensions.x-py-model-imports}}
+from typing import Any, List
+from pydantic import StrictStr, Field
+
+{{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ANY_OF_SCHEMAS = [{{#anyOf}}"{{.}}"{{^-last}}, {{/-last}}{{/anyOf}}]
+
+class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+{{#composedSchemas.anyOf}}
+ # data type: {{{dataType}}}
+ {{vendorExtensions.x-py-name}}: {{{vendorExtensions.x-py-typing}}}
+{{/composedSchemas.anyOf}}
+ actual_instance: Any
+ any_of_schemas: List[str] = Field({{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ANY_OF_SCHEMAS, const=True)
+
+ class Config:
+ validate_assignment = True
+{{#discriminator}}
+
+ discriminator_value_class_map = {
+{{#children}}
+ '{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}},{{/-last}}
+{{/children}}
+ }
+{{/discriminator}}
+
+ @validator('actual_instance')
+ def actual_instance_must_validate_anyof(cls, v):
+ error_messages = []
+ {{#composedSchemas.anyOf}}
+ # validate data type: {{{dataType}}}
+ if type(v) is not {{^isPrimitiveType}}{{/isPrimitiveType}}{{{dataType}}}:
+ error_messages.append(f"Error! Input type `{type(v)}` is not `{{{dataType}}}`")
+ else:
+ return v
+
+ {{/composedSchemas.anyOf}}
+ if error_messages:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into {{{classname}}} with anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. Details: " + ", ".join(error_messages))
+ else:
+ return v
+
+ @classmethod
+ def from_json(cls, json_str: str) -> {{{classname}}}:
+ """Returns the object represented by the json string"""
+ instance = cls()
+ error_messages = []
+ {{#composedSchemas.anyOf}}
+ {{^isPrimitiveType}}
+ # {{vendorExtensions.x-py-name}}: {{{vendorExtensions.x-py-typing}}}
+ try:
+ instance.actual_instance = {{{dataType}}}.from_json(json_str)
+ return instance
+ except ValidationError as e:
+ error_messages.append(str(e))
+ {{/isPrimitiveType}}
+ {{/composedSchemas.anyOf}}
+
+ if error_messages:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into {{{classname}}} with anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. Details: " + ", ".join(error_messages))
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is not None:
+ return self.actual_instance.to_json()
+ else:
+ return "null"
+
+ def to_dict(self) -> dict:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is not None:
+ return self.actual_instance.to_dict()
+ else:
+ return dict()
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.dict())
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/model_doc.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/model_doc.mustache
new file mode 100644
index 00000000000..dd54470b3be
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/model_doc.mustache
@@ -0,0 +1,33 @@
+{{#models}}{{#model}}# {{classname}}
+
+{{#description}}{{&description}}
+{{/description}}
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
+{{/vars}}
+
+{{^isEnum}}
+## Example
+
+```python
+from {{modelPackage}}.{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}} import {{classname}}
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of {{classname}} from a JSON string
+{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_instance = {{classname}}.from_json(json)
+# print the JSON string representation of the object
+print {{classname}}.to_json()
+
+# convert the object into a dict
+{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict = {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_instance.to_dict()
+# create an instance of {{classname}} from a dict
+{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_form_dict = {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}.from_dict({{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict)
+```
+{{/isEnum}}
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+{{/model}}{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/model_enum.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/model_enum.mustache
new file mode 100644
index 00000000000..e5b96967451
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/model_enum.mustache
@@ -0,0 +1,32 @@
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+{{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}}
+{{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}}
+{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}}
+
+
+class {{classname}}({{vendorExtensions.x-py-enum-type}}, Enum):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ """
+ allowed enum values
+ """
+
+{{#allowableValues}}
+ {{#enumVars}}
+ {{{name}}} = {{{value}}}
+ {{/enumVars}}
+ {{#defaultValue}}
+ #
+ @classmethod
+ def _missing_value_(cls, value):
+ if value is no_arg:
+ return cls.{{{.}}}
+ {{/defaultValue}}
+{{/allowableValues}}
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/model_generic.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/model_generic.mustache
new file mode 100644
index 00000000000..6c2b3432cfd
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/model_generic.mustache
@@ -0,0 +1,258 @@
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+{{#hasChildren}}
+{{#discriminator}}
+import {{{modelPackage}}}
+{{/discriminator}}
+{{/hasChildren}}
+
+{{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}}
+{{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}}
+{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}}
+{{#vendorExtensions.x-py-model-imports}}
+{{{.}}}
+{{/vendorExtensions.x-py-model-imports}}
+
+class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+{{#vars}}
+ {{name}}: {{{vendorExtensions.x-py-typing}}}
+{{/vars}}
+{{#isAdditionalPropertiesTrue}}
+ additional_properties: Dict[str, Any] = {}
+{{/isAdditionalPropertiesTrue}}
+ __properties = [{{#allVars}}"{{baseName}}"{{^-last}}, {{/-last}}{{/allVars}}]
+{{#vars}}
+ {{#vendorExtensions.x-regex}}
+
+ @validator('{{{name}}}')
+ def {{{name}}}_validate_regular_expression(cls, v):
+ if not re.match(r"{{{.}}}", v{{#vendorExtensions.x-modifiers}} ,re.{{{.}}}{{/vendorExtensions.x-modifiers}}):
+ raise ValueError(r"must validate the regular expression {{{pattern}}}")
+ return v
+ {{/vendorExtensions.x-regex}}
+ {{#isEnum}}
+
+ @validator('{{{name}}}')
+ def {{{name}}}_validate_enum(cls, v):
+ {{^required}}
+ if v is None:
+ return v
+
+ {{/required}}
+ if v not in ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}):
+ raise ValueError("must validate the enum values ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}})")
+ return v
+ {{/isEnum}}
+{{/vars}}
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+{{#hasChildren}}
+{{#discriminator}}
+ # JSON field name that stores the object type
+ __discriminator_property_name = '{{discriminator.propertyBaseName}}'
+
+ {{#mappedModels}}
+ {{#-first}}
+ # discriminator mappings
+ __discriminator_value_class_map = {
+ {{/-first}}
+ '{{{mappingName}}}': '{{{modelName}}}'{{^-last}},{{/-last}}
+ {{#-last}}
+ }
+
+ @classmethod
+ def get_discriminator_value(cls, obj: dict) -> str:
+ """Returns the discriminator value (object type) of the data"""
+ discriminator_value = obj[cls.__discriminator_property_name]
+ if discriminator_value:
+ return cls.__discriminator_value_class_map.get(discriminator_value)
+ else:
+ return None
+ {{/-last}}
+ {{/mappedModels}}
+
+{{/discriminator}}
+{{/hasChildren}}
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> {{^hasChildren}}{{{classname}}}{{/hasChildren}}{{#hasChildren}}{{#discriminator}}Union({{#children}}{{{classname}}}{{^-last}}, {{/-last}}{{/children}}){{/discriminator}}{{^discriminator}}{{{classname}}}{{/discriminator}}{{/hasChildren}}:
+ """Create an instance of {{{classname}}} from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ {{#vendorExtensions.x-py-readonly}}
+ "{{{.}}}",
+ {{/vendorExtensions.x-py-readonly}}
+ {{#isAdditionalPropertiesTrue}}
+ "additional_properties"
+ {{/isAdditionalPropertiesTrue}}
+ },
+ exclude_none=True)
+ {{#allVars}}
+ {{#isContainer}}
+ {{#isArray}}
+ {{^items.isPrimitiveType}}
+ {{^items.isEnumOrRef}}
+ # override the default output from pydantic by calling `to_dict()` of each item in {{{name}}} (list)
+ _items = []
+ if self.{{{name}}}:
+ for _item in self.{{{name}}}:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict['{{{baseName}}}'] = _items
+ {{/items.isEnumOrRef}}
+ {{/items.isPrimitiveType}}
+ {{/isArray}}
+ {{#isMap}}
+ {{^items.isPrimitiveType}}
+ {{^items.isEnumOrRef}}
+ # override the default output from pydantic by calling `to_dict()` of each value in {{{name}}} (dict)
+ _field_dict = {}
+ if self.{{{name}}}:
+ for _key in self.{{{name}}}:
+ if self.{{{name}}}[_key]:
+ _field_dict[_key] = self.{{{name}}}[_key].to_dict()
+ _dict['{{{baseName}}}'] = _field_dict
+ {{/items.isEnumOrRef}}
+ {{/items.isPrimitiveType}}
+ {{/isMap}}
+ {{/isContainer}}
+ {{^isContainer}}
+ {{^isPrimitiveType}}
+ {{^isEnumOrRef}}
+ # override the default output from pydantic by calling `to_dict()` of {{{name}}}
+ if self.{{{name}}}:
+ _dict['{{{baseName}}}'] = self.{{{name}}}.to_dict()
+ {{/isEnumOrRef}}
+ {{/isPrimitiveType}}
+ {{/isContainer}}
+ {{/allVars}}
+ {{#isAdditionalPropertiesTrue}}
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ {{/isAdditionalPropertiesTrue}}
+ {{#allVars}}
+ {{#isNullable}}
+ # set to None if {{{name}}} (nullable) is None
+ if self.{{name}} is None:
+ _dict['{{{baseName}}}'] = None
+
+ {{/isNullable}}
+ {{/allVars}}
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> {{^hasChildren}}{{{classname}}}{{/hasChildren}}{{#hasChildren}}{{#discriminator}}Union({{#children}}{{{classname}}}{{^-last}}, {{/-last}}{{/children}}){{/discriminator}}{{^discriminator}}{{{classname}}}{{/discriminator}}{{/hasChildren}}:
+ """Create an instance of {{{classname}}} from a dict"""
+ {{#hasChildren}}
+ {{#discriminator}}
+ # look up the object type based on discriminator mapping
+ object_type = cls.get_discriminator_value(obj)
+ if object_type:
+ klass = getattr({{modelPackage}}, object_type)
+ return klass.from_dict(obj)
+ else:
+ raise ValueError("{{{classname}}} failed to lookup discriminator value from " +
+ json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name +
+ ", mapping: " + json.dumps(cls.__discriminator_value_class_map))
+ {{/discriminator}}
+ {{/hasChildren}}
+ {{^hasChildren}}
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return {{{classname}}}.parse_obj(obj)
+
+ {{#disallowAdditionalPropertiesIfNotPresent}}
+ {{^isAdditionalPropertiesTrue}}
+ # raise errors for additional fields in the input
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ raise ValueError("Error due to additional fields (not defined in {{classname}}) in the input: " + obj)
+
+ {{/isAdditionalPropertiesTrue}}
+ {{/disallowAdditionalPropertiesIfNotPresent}}
+ _obj = {{{classname}}}.parse_obj({
+ {{#allVars}}
+ {{#isContainer}}
+ {{#isArray}}
+ {{^items.isPrimitiveType}}
+ {{#items.isEnumOrRef}}
+ "{{{name}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}}
+ {{/items.isEnumOrRef}}
+ {{^items.isEnumOrRef}}
+ "{{{name}}}": [{{{items.dataType}}}.from_dict(_item) for _item in obj.get("{{{baseName}}}")] if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}}
+ {{/items.isEnumOrRef}}
+ {{/items.isPrimitiveType}}
+ {{#items.isPrimitiveType}}
+ "{{{name}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}}
+ {{/items.isPrimitiveType}}
+ {{/isArray}}
+ {{#isMap}}
+ {{^items.isPrimitiveType}}
+ {{^items.isEnumOrRef}}
+ "{{{name}}}": dict((_k, {{{dataType}}}.from_dict(_v)) for _k, _v in obj.get("{{{baseName}}}").items()){{^-last}},{{/-last}}
+ {{/items.isEnumOrRef}}
+ {{#items.isEnumOrRef}}
+ "{{{name}}}": dict((_k, _v) for _k, _v in obj.get("{{{baseName}}}").items()){{^-last}},{{/-last}}
+ {{/items.isEnumOrRef}}
+ {{/items.isPrimitiveType}}
+ {{#items.isPrimitiveType}}
+ "{{{name}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}}
+ {{/items.isPrimitiveType}}
+ {{/isMap}}
+ {{/isContainer}}
+ {{^isContainer}}
+ {{^isPrimitiveType}}
+ {{^isEnumOrRef}}
+ "{{{name}}}": {{{dataType}}}.from_dict(obj.get("{{{baseName}}}")) if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}}
+ {{/isEnumOrRef}}
+ {{#isEnumOrRef}}
+ "{{{name}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}}
+ {{/isEnumOrRef}}
+ {{/isPrimitiveType}}
+ {{#isPrimitiveType}}
+ {{#defaultValue}}
+ "{{{name}}}": obj.get("{{{baseName}}}") if obj.get("{{{baseName}}}") is not None else {{{defaultValue}}}{{^-last}},{{/-last}}
+ {{/defaultValue}}
+ {{^defaultValue}}
+ "{{{name}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}}
+ {{/defaultValue}}
+ {{/isPrimitiveType}}
+ {{/isContainer}}
+ {{/allVars}}
+ })
+ {{#isAdditionalPropertiesTrue}}
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ {{/isAdditionalPropertiesTrue}}
+ return _obj
+ {{/hasChildren}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/model_oneof.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/model_oneof.mustache
new file mode 100644
index 00000000000..94cf5a0fd22
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/model_oneof.mustache
@@ -0,0 +1,131 @@
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import json
+import re # noqa: F401
+{{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}}
+{{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}}
+{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}}
+{{#vendorExtensions.x-py-model-imports}}
+{{{.}}}
+{{/vendorExtensions.x-py-model-imports}}
+from typing import Any, List
+from pydantic import StrictStr, Field
+
+{{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ONE_OF_SCHEMAS = [{{#oneOf}}"{{.}}"{{^-last}}, {{/-last}}{{/oneOf}}]
+
+class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+{{#composedSchemas.oneOf}}
+ # data type: {{{dataType}}}
+ {{vendorExtensions.x-py-name}}: {{{vendorExtensions.x-py-typing}}}
+{{/composedSchemas.oneOf}}
+ actual_instance: Any
+ one_of_schemas: List[str] = Field({{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ONE_OF_SCHEMAS, const=True)
+
+ class Config:
+ validate_assignment = True
+{{#discriminator}}
+
+ discriminator_value_class_map = {
+{{#children}}
+ '{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}},{{/-last}}
+{{/children}}
+ }
+{{/discriminator}}
+
+ @validator('actual_instance')
+ def actual_instance_must_validate_oneof(cls, v):
+ error_messages = []
+ match = 0
+ {{#composedSchemas.oneOf}}
+ # validate data type: {{{dataType}}}
+ if type(v) is not {{^isPrimitiveType}}{{/isPrimitiveType}}{{{dataType}}}:
+ error_messages.append(f"Error! Input type `{type(v)}` is not `{{{dataType}}}`")
+ else:
+ match += 1
+
+ {{/composedSchemas.oneOf}}
+ if match > 1:
+ # more than 1 match
+ raise ValueError("Multiple matches found when deserializing the JSON string into {{{classname}}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. Details: " + ", ".join(error_messages))
+ elif match == 0:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into {{{classname}}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. Details: " + ", ".join(error_messages))
+ else:
+ return v
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> {{{classname}}}:
+ return cls.from_json(json.dumps(obj))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> {{{classname}}}:
+ """Returns the object represented by the json string"""
+ instance = cls()
+ error_messages = []
+ match = 0
+
+ {{#useOneOfDiscriminatorLookup}}
+ {{#discriminator}}
+ {{#mappedModels}}
+ {{#-first}}
+ # use oneOf discriminator to lookup the data type
+ _data_type = json.loads(json_str).get("{{{propertyBaseName}}}")
+ if not _data_type:
+ raise ValueError("Failed to lookup data type from the field `{{{propertyBaseName}}}` in the input.")
+
+ {{/-first}}
+ # check if data type is `{{{modelName}}}`
+ if _data_type == "{{{mappingName}}}":
+ instance.actual_instance = {{{modelName}}}.from_json(json_str)
+ return instance
+
+ {{/mappedModels}}
+ {{/discriminator}}
+ {{/useOneOfDiscriminatorLookup}}
+ {{#composedSchemas.oneOf}}
+ {{^isPrimitiveType}}
+ # deserialize data into {{{dataType}}}
+ try:
+ instance.actual_instance = {{{dataType}}}.from_json(json_str)
+ match += 1
+ except ValidationError as e:
+ error_messages.append(str(e))
+ {{/isPrimitiveType}}
+ {{/composedSchemas.oneOf}}
+
+ if match > 1:
+ # more than 1 match
+ raise ValueError("Multiple matches found when deserializing the JSON string into {{{classname}}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. Details: " + ", ".join(error_messages))
+ elif match == 0:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into {{{classname}}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. Details: " + ", ".join(error_messages))
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is not None:
+ return self.actual_instance.to_json()
+ else:
+ return "null"
+
+ def to_dict(self) -> dict:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is not None:
+ return self.actual_instance.to_dict()
+ else:
+ return dict()
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.dict())
+
+
+
+
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/model_test.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/model_test.mustache
new file mode 100644
index 00000000000..06d8b5fa95c
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/model_test.mustache
@@ -0,0 +1,64 @@
+# coding: utf-8
+
+{{>partial_header}}
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+{{#models}}
+{{#model}}
+import {{packageName}}
+from {{modelPackage}}.{{classFilename}} import {{classname}} # noqa: E501
+from {{packageName}}.rest import ApiException
+
+class Test{{classname}}(unittest.TestCase):
+ """{{classname}} unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+{{^isEnum}}
+
+ def make_instance(self, include_optional):
+ """Test {{classname}}
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `{{{classname}}}`
+ """
+ model = {{packageName}}.models.{{classFilename}}.{{classname}}() # noqa: E501
+ if include_optional :
+ return {{classname}}(
+ {{#vars}}
+ {{name}} = {{{example}}}{{^example}}None{{/example}}{{^-last}}, {{/-last}}
+ {{/vars}}
+ )
+ else :
+ return {{classname}}(
+ {{#vars}}
+ {{#required}}
+ {{name}} = {{{example}}}{{^example}}None{{/example}},
+ {{/required}}
+ {{/vars}}
+ )
+ """
+{{/isEnum}}
+
+ def test{{classname}}(self):
+ """Test {{classname}}"""
+{{^isEnum}}
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+{{/isEnum}}
+{{#isEnum}}
+ # inst = {{{classname}}}()
+{{/isEnum}}
+{{/model}}
+{{/models}}
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/partial_header.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/partial_header.mustache
new file mode 100644
index 00000000000..dc3c8f3d8c8
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/partial_header.mustache
@@ -0,0 +1,17 @@
+"""
+{{#appName}}
+ {{{.}}}
+{{/appName}}
+
+{{#appDescription}}
+ {{{.}}} # noqa: E501
+{{/appDescription}}
+
+ {{#version}}
+ The version of the OpenAPI document: {{{.}}}
+ {{/version}}
+ {{#infoEmail}}
+ Contact: {{{.}}}
+ {{/infoEmail}}
+ Generated by: https://openapi-generator.tech
+"""
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/python_doc_auth_partial.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/python_doc_auth_partial.mustache
new file mode 100644
index 00000000000..ba0382371eb
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/python_doc_auth_partial.mustache
@@ -0,0 +1,105 @@
+# Defining the host is optional and defaults to {{{basePath}}}
+# See configuration.py for a list of all supported configuration parameters.
+configuration = {{{packageName}}}.Configuration(
+ host = "{{{basePath}}}"
+)
+
+{{#hasAuthMethods}}
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+{{#authMethods}}
+{{#isBasic}}
+{{#isBasicBasic}}
+
+# Configure HTTP basic authorization: {{{name}}}
+configuration = {{{packageName}}}.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+{{/isBasicBasic}}
+{{#isBasicBearer}}
+
+# Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}}
+configuration = {{{packageName}}}.Configuration(
+ access_token = os.environ["BEARER_TOKEN"]
+)
+{{/isBasicBearer}}
+{{#isHttpSignature}}
+
+# Configure HTTP message signature: {{{name}}}
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See {{{packageName}}}.signing for a list of all supported parameters.
+configuration = {{{packageName}}}.Configuration(
+ host = "{{{basePath}}}",
+ signing_info = {{{packageName}}}.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019,
+ signing_algorithm = {{{packageName}}}.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = {{{packageName}}}.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ {{{packageName}}}.signing.HEADER_REQUEST_TARGET,
+ {{{packageName}}}.signing.HEADER_CREATED,
+ {{{packageName}}}.signing.HEADER_EXPIRES,
+ {{{packageName}}}.signing.HEADER_HOST,
+ {{{packageName}}}.signing.HEADER_DATE,
+ {{{packageName}}}.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+{{/isHttpSignature}}
+{{/isBasic}}
+{{#isApiKey}}
+
+# Configure API key authorization: {{{name}}}
+configuration.api_key['{{{name}}}'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['{{name}}'] = 'Bearer'
+{{/isApiKey}}
+{{#isOAuth}}
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+{{/isOAuth}}
+{{/authMethods}}
+{{/hasAuthMethods}}
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/requirements.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/requirements.mustache
new file mode 100644
index 00000000000..b64659a0a91
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/requirements.mustache
@@ -0,0 +1,8 @@
+python_dateutil >= 2.5.3
+setuptools >= 21.0.0
+urllib3 >= 1.25.3
+pydantic >= 1.10.2
+aenum >= 3.1.11
+{{#asyncio}}
+aiohttp >= 3.0.0
+{{/asyncio}}
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/rest.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/rest.mustache
new file mode 100644
index 00000000000..37646f94f21
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/rest.mustache
@@ -0,0 +1,288 @@
+# coding: utf-8
+
+{{>partial_header}}
+
+from __future__ import absolute_import
+
+import io
+import json
+import logging
+import re
+import ssl
+
+from urllib.parse import urlencode, quote_plus
+import urllib3
+
+from {{packageName}}.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
+
+
+logger = logging.getLogger(__name__)
+
+
+class RESTResponse(io.IOBase):
+
+ def __init__(self, resp):
+ self.urllib3_response = resp
+ self.status = resp.status
+ self.reason = resp.reason
+ self.data = resp.data
+
+ def getheaders(self):
+ """Returns a dictionary of the response headers."""
+ return self.urllib3_response.getheaders()
+
+ def getheader(self, name, default=None):
+ """Returns a given response header."""
+ return self.urllib3_response.getheader(name, default)
+
+
+class RESTClientObject(object):
+
+ def __init__(self, configuration, pools_size=4, maxsize=None):
+ # urllib3.PoolManager will pass all kw parameters to connectionpool
+ # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501
+ # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501
+ # maxsize is the number of requests to host that are allowed in parallel # noqa: E501
+ # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501
+
+ # cert_reqs
+ if configuration.verify_ssl:
+ cert_reqs = ssl.CERT_REQUIRED
+ else:
+ cert_reqs = ssl.CERT_NONE
+
+ addition_pool_args = {}
+ if configuration.assert_hostname is not None:
+ addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
+
+ if configuration.retries is not None:
+ addition_pool_args['retries'] = configuration.retries
+
+ if configuration.socket_options is not None:
+ addition_pool_args['socket_options'] = configuration.socket_options
+
+ if maxsize is None:
+ if configuration.connection_pool_maxsize is not None:
+ maxsize = configuration.connection_pool_maxsize
+ else:
+ maxsize = 4
+
+ # https pool manager
+ if configuration.proxy:
+ self.pool_manager = urllib3.ProxyManager(
+ num_pools=pools_size,
+ maxsize=maxsize,
+ cert_reqs=cert_reqs,
+ ca_certs=configuration.ssl_ca_cert,
+ cert_file=configuration.cert_file,
+ key_file=configuration.key_file,
+ proxy_url=configuration.proxy,
+ proxy_headers=configuration.proxy_headers,
+ **addition_pool_args
+ )
+ else:
+ self.pool_manager = urllib3.PoolManager(
+ num_pools=pools_size,
+ maxsize=maxsize,
+ cert_reqs=cert_reqs,
+ ca_certs=configuration.ssl_ca_cert,
+ cert_file=configuration.cert_file,
+ key_file=configuration.key_file,
+ **addition_pool_args
+ )
+
+ def request(self, method, url, query_params=None, headers=None,
+ body=None, post_params=None, _preload_content=True,
+ _request_timeout=None):
+ """Perform requests.
+
+ :param method: http request method
+ :param url: http request url
+ :param query_params: query parameters in the url
+ :param headers: http request headers
+ :param body: request json body, for `application/json`
+ :param post_params: request post parameters,
+ `application/x-www-form-urlencoded`
+ and `multipart/form-data`
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ """
+ method = method.upper()
+ assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
+ 'PATCH', 'OPTIONS']
+
+ if post_params and body:
+ raise ApiValueError(
+ "body parameter cannot be used with post_params parameter."
+ )
+
+ post_params = post_params or {}
+ headers = headers or {}
+ # url already contains the URL query string
+ # so reset query_params to empty dict
+ query_params = {}
+
+ timeout = None
+ if _request_timeout:
+ if isinstance(_request_timeout, (int,float)): # noqa: E501,F821
+ timeout = urllib3.Timeout(total=_request_timeout)
+ elif (isinstance(_request_timeout, tuple) and
+ len(_request_timeout) == 2):
+ timeout = urllib3.Timeout(
+ connect=_request_timeout[0], read=_request_timeout[1])
+
+ try:
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
+ if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
+
+ # no content type provided or payload is json
+ if not headers.get('Content-Type') or re.search('json', headers['Content-Type'], re.IGNORECASE):
+ request_body = None
+ if body is not None:
+ request_body = json.dumps(body)
+ r = self.pool_manager.request(
+ method, url,
+ body=request_body,
+ preload_content=_preload_content,
+ timeout=timeout,
+ headers=headers)
+ elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
+ r = self.pool_manager.request(
+ method, url,
+ fields=post_params,
+ encode_multipart=False,
+ preload_content=_preload_content,
+ timeout=timeout,
+ headers=headers)
+ elif headers['Content-Type'] == 'multipart/form-data':
+ # must del headers['Content-Type'], or the correct
+ # Content-Type which generated by urllib3 will be
+ # overwritten.
+ del headers['Content-Type']
+ r = self.pool_manager.request(
+ method, url,
+ fields=post_params,
+ encode_multipart=True,
+ preload_content=_preload_content,
+ timeout=timeout,
+ headers=headers)
+ # Pass a `string` parameter directly in the body to support
+ # other content types than Json when `body` argument is
+ # provided in serialized form
+ elif isinstance(body, str) or isinstance(body, bytes):
+ request_body = body
+ r = self.pool_manager.request(
+ method, url,
+ body=request_body,
+ preload_content=_preload_content,
+ timeout=timeout,
+ headers=headers)
+ else:
+ # Cannot generate the request from given parameters
+ msg = """Cannot prepare a request message for provided
+ arguments. Please check that your arguments match
+ declared content type."""
+ raise ApiException(status=0, reason=msg)
+ # For `GET`, `HEAD`
+ else:
+ r = self.pool_manager.request(method, url,
+ fields={},
+ preload_content=_preload_content,
+ timeout=timeout,
+ headers=headers)
+ except urllib3.exceptions.SSLError as e:
+ msg = "{0}\n{1}".format(type(e).__name__, str(e))
+ raise ApiException(status=0, reason=msg)
+
+ if _preload_content:
+ r = RESTResponse(r)
+
+ # log response body
+ logger.debug("response body: %s", r.data)
+
+ if not 200 <= r.status <= 299:
+ if r.status == 401:
+ raise UnauthorizedException(http_resp=r)
+
+ if r.status == 403:
+ raise ForbiddenException(http_resp=r)
+
+ if r.status == 404:
+ raise NotFoundException(http_resp=r)
+
+ if 500 <= r.status <= 599:
+ raise ServiceException(http_resp=r)
+
+ raise ApiException(http_resp=r)
+
+ return r
+
+ def get_request(self, url, headers=None, query_params=None, _preload_content=True,
+ _request_timeout=None):
+ return self.request("GET", url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params)
+
+ def head_request(self, url, headers=None, query_params=None, _preload_content=True,
+ _request_timeout=None):
+ return self.request("HEAD", url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params)
+
+ def options_request(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ return self.request("OPTIONS", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+
+ def delete_request(self, url, headers=None, query_params=None, body=None,
+ _preload_content=True, _request_timeout=None):
+ return self.request("DELETE", url,
+ headers=headers,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+
+ def post_request(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ return self.request("POST", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+
+ def put_request(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ return self.request("PUT", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+
+ def patch_request(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ return self.request("PATCH", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/setup.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/setup.mustache
new file mode 100644
index 00000000000..77760324f82
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/setup.mustache
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+{{>partial_header}}
+
+from setuptools import setup, find_packages # noqa: H301
+
+# To install the library, run the following
+#
+# python setup.py install
+#
+# prerequisite: setuptools
+# http://pypi.python.org/pypi/setuptools
+NAME = "{{{projectName}}}"
+VERSION = "{{packageVersion}}"
+PYTHON_REQUIRES = ">=3.7"
+{{#apiInfo}}
+{{#apis}}
+{{#-last}}
+REQUIRES = [
+ "urllib3 >= 1.25.3",
+ "python-dateutil",
+{{#asyncio}}
+ "aiohttp >= 3.0.0",
+{{/asyncio}}
+{{#tornado}}
+ "tornado>=4.2,<5",
+{{/tornado}}
+{{#hasHttpSignatureMethods}}
+ "pem>=19.3.0",
+ "pycryptodome>=3.9.0",
+{{/hasHttpSignatureMethods}}
+ "pydantic",
+ "aenum"
+]
+
+setup(
+ name=NAME,
+ version=VERSION,
+ description="{{appName}}",
+ author="{{infoName}}{{^infoName}}OpenAPI Generator community{{/infoName}}",
+ author_email="{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}",
+ url="{{packageUrl}}",
+ keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"],
+ install_requires=REQUIRES,
+ packages=find_packages(exclude=["test", "tests"]),
+ include_package_data=True,
+ {{#licenseInfo}}license="{{.}}",
+ {{/licenseInfo}}long_description_content_type='text/markdown',
+ long_description="""\
+ {{appDescription}} # noqa: E501
+ """
+)
+{{/-last}}
+{{/apis}}
+{{/apiInfo}}
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/setup_cfg.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/setup_cfg.mustache
new file mode 100644
index 00000000000..11433ee875a
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/setup_cfg.mustache
@@ -0,0 +1,2 @@
+[flake8]
+max-line-length=99
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/signing.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/signing.mustache
new file mode 100644
index 00000000000..24889edbd6d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/signing.mustache
@@ -0,0 +1,408 @@
+{{>partial_header}}
+
+from base64 import b64encode
+from Crypto.IO import PEM, PKCS8
+from Crypto.Hash import SHA256, SHA512
+from Crypto.PublicKey import RSA, ECC
+from Crypto.Signature import PKCS1_v1_5, pss, DSS
+from email.utils import formatdate
+import json
+import os
+import re
+from time import time
+from urllib.parse import urlencode, urlparse
+
+# The constants below define a subset of HTTP headers that can be included in the
+# HTTP signature scheme. Additional headers may be included in the signature.
+
+# The '(request-target)' header is a calculated field that includes the HTTP verb,
+# the URL path and the URL query.
+HEADER_REQUEST_TARGET = '(request-target)'
+# The time when the HTTP signature was generated.
+HEADER_CREATED = '(created)'
+# The time when the HTTP signature expires. The API server should reject HTTP requests
+# that have expired.
+HEADER_EXPIRES = '(expires)'
+# The 'Host' header.
+HEADER_HOST = 'Host'
+# The 'Date' header.
+HEADER_DATE = 'Date'
+# When the 'Digest' header is included in the HTTP signature, the client automatically
+# computes the digest of the HTTP request body, per RFC 3230.
+HEADER_DIGEST = 'Digest'
+# The 'Authorization' header is automatically generated by the client. It includes
+# the list of signed headers and a base64-encoded signature.
+HEADER_AUTHORIZATION = 'Authorization'
+
+# The constants below define the cryptographic schemes for the HTTP signature scheme.
+SCHEME_HS2019 = 'hs2019'
+SCHEME_RSA_SHA256 = 'rsa-sha256'
+SCHEME_RSA_SHA512 = 'rsa-sha512'
+
+# The constants below define the signature algorithms that can be used for the HTTP
+# signature scheme.
+ALGORITHM_RSASSA_PSS = 'RSASSA-PSS'
+ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5'
+
+ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3'
+ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979'
+ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = {
+ ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979
+}
+
+# The cryptographic hash algorithm for the message signature.
+HASH_SHA256 = 'sha256'
+HASH_SHA512 = 'sha512'
+
+
+class HttpSigningConfiguration(object):
+ """The configuration parameters for the HTTP signature security scheme.
+ The HTTP signature security scheme is used to sign HTTP requests with a private key
+ which is in possession of the API client.
+ An 'Authorization' header is calculated by creating a hash of select headers,
+ and optionally the body of the HTTP request, then signing the hash value using
+ a private key. The 'Authorization' header is added to outbound HTTP requests.
+
+ NOTE: This class is auto generated by OpenAPI Generator
+
+ Ref: https://openapi-generator.tech
+ Do not edit the class manually.
+
+ :param key_id: A string value specifying the identifier of the cryptographic key,
+ when signing HTTP requests.
+ :param signing_scheme: A string value specifying the signature scheme, when
+ signing HTTP requests.
+ Supported value are hs2019, rsa-sha256, rsa-sha512.
+ Avoid using rsa-sha256, rsa-sha512 as they are deprecated. These values are
+ available for server-side applications that only support the older
+ HTTP signature algorithms.
+ :param private_key_path: A string value specifying the path of the file containing
+ a private key. The private key is used to sign HTTP requests.
+ :param private_key_passphrase: A string value specifying the passphrase to decrypt
+ the private key.
+ :param signed_headers: A list of strings. Each value is the name of a HTTP header
+ that must be included in the HTTP signature calculation.
+ The two special signature headers '(request-target)' and '(created)' SHOULD be
+ included in SignedHeaders.
+ The '(created)' header expresses when the signature was created.
+ The '(request-target)' header is a concatenation of the lowercased :method, an
+ ASCII space, and the :path pseudo-headers.
+ When signed_headers is not specified, the client defaults to a single value,
+ '(created)', in the list of HTTP headers.
+ When SignedHeaders contains the 'Digest' value, the client performs the
+ following operations:
+ 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2.
+ 2. Set the 'Digest' header in the request body.
+ 3. Include the 'Digest' header and value in the HTTP signature.
+ :param signing_algorithm: A string value specifying the signature algorithm, when
+ signing HTTP requests.
+ Supported values are:
+ 1. For RSA keys: RSASSA-PSS, RSASSA-PKCS1-v1_5.
+ 2. For ECDSA keys: fips-186-3, deterministic-rfc6979.
+ If None, the signing algorithm is inferred from the private key.
+ The default signing algorithm for RSA keys is RSASSA-PSS.
+ The default signing algorithm for ECDSA keys is fips-186-3.
+ :param hash_algorithm: The hash algorithm for the signature. Supported values are
+ sha256 and sha512.
+ If the signing_scheme is rsa-sha256, the hash algorithm must be set
+ to None or sha256.
+ If the signing_scheme is rsa-sha512, the hash algorithm must be set
+ to None or sha512.
+ :param signature_max_validity: The signature max validity, expressed as
+ a datetime.timedelta value. It must be a positive value.
+ """
+ def __init__(self, key_id, signing_scheme, private_key_path,
+ private_key_passphrase=None,
+ signed_headers=None,
+ signing_algorithm=None,
+ hash_algorithm=None,
+ signature_max_validity=None):
+ self.key_id = key_id
+ if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}:
+ raise Exception("Unsupported security scheme: {0}".format(signing_scheme))
+ self.signing_scheme = signing_scheme
+ if not os.path.exists(private_key_path):
+ raise Exception("Private key file does not exist")
+ self.private_key_path = private_key_path
+ self.private_key_passphrase = private_key_passphrase
+ self.signing_algorithm = signing_algorithm
+ self.hash_algorithm = hash_algorithm
+ if signing_scheme == SCHEME_RSA_SHA256:
+ if self.hash_algorithm is None:
+ self.hash_algorithm = HASH_SHA256
+ elif self.hash_algorithm != HASH_SHA256:
+ raise Exception("Hash algorithm must be sha256 when security scheme is %s" %
+ SCHEME_RSA_SHA256)
+ elif signing_scheme == SCHEME_RSA_SHA512:
+ if self.hash_algorithm is None:
+ self.hash_algorithm = HASH_SHA512
+ elif self.hash_algorithm != HASH_SHA512:
+ raise Exception("Hash algorithm must be sha512 when security scheme is %s" %
+ SCHEME_RSA_SHA512)
+ elif signing_scheme == SCHEME_HS2019:
+ if self.hash_algorithm is None:
+ self.hash_algorithm = HASH_SHA256
+ elif self.hash_algorithm not in {HASH_SHA256, HASH_SHA512}:
+ raise Exception("Invalid hash algorithm")
+ if signature_max_validity is not None and signature_max_validity.total_seconds() < 0:
+ raise Exception("The signature max validity must be a positive value")
+ self.signature_max_validity = signature_max_validity
+ # If the user has not provided any signed_headers, the default must be set to '(created)',
+ # as specified in the 'HTTP signature' standard.
+ if signed_headers is None or len(signed_headers) == 0:
+ signed_headers = [HEADER_CREATED]
+ if self.signature_max_validity is None and HEADER_EXPIRES in signed_headers:
+ raise Exception(
+ "Signature max validity must be set when "
+ "'(expires)' signature parameter is specified")
+ if len(signed_headers) != len(set(signed_headers)):
+ raise Exception("Cannot have duplicates in the signed_headers parameter")
+ if HEADER_AUTHORIZATION in signed_headers:
+ raise Exception("'Authorization' header cannot be included in signed headers")
+ self.signed_headers = signed_headers
+ self.private_key = None
+ """The private key used to sign HTTP requests.
+ Initialized when the PEM-encoded private key is loaded from a file.
+ """
+ self.host = None
+ """The host name, optionally followed by a colon and TCP port number.
+ """
+ self._load_private_key()
+
+ def get_http_signature_headers(self, resource_path, method, headers, body, query_params):
+ """Create a cryptographic message signature for the HTTP request and add the signed headers.
+
+ :param resource_path : A string representation of the HTTP request resource path.
+ :param method: A string representation of the HTTP request method, e.g. GET, POST.
+ :param headers: A dict containing the HTTP request headers.
+ :param body: The object representing the HTTP request body.
+ :param query_params: A string representing the HTTP request query parameters.
+ :return: A dict of HTTP headers that must be added to the outbound HTTP request.
+ """
+ if method is None:
+ raise Exception("HTTP method must be set")
+ if resource_path is None:
+ raise Exception("Resource path must be set")
+
+ signed_headers_list, request_headers_dict = self._get_signed_header_info(
+ resource_path, method, headers, body, query_params)
+
+ header_items = [
+ "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list]
+ string_to_sign = "\n".join(header_items)
+
+ digest, digest_prefix = self._get_message_digest(string_to_sign.encode())
+ b64_signed_msg = self._sign_digest(digest)
+
+ request_headers_dict[HEADER_AUTHORIZATION] = self._get_authorization_header(
+ signed_headers_list, b64_signed_msg)
+
+ return request_headers_dict
+
+ def get_public_key(self):
+ """Returns the public key object associated with the private key.
+ """
+ pubkey = None
+ if isinstance(self.private_key, RSA.RsaKey):
+ pubkey = self.private_key.publickey()
+ elif isinstance(self.private_key, ECC.EccKey):
+ pubkey = self.private_key.public_key()
+ return pubkey
+
+ def _load_private_key(self):
+ """Load the private key used to sign HTTP requests.
+ The private key is used to sign HTTP requests as defined in
+ https://datatracker.ietf.org/doc/draft-cavage-http-signatures/.
+ """
+ if self.private_key is not None:
+ return
+ with open(self.private_key_path, 'r') as f:
+ pem_data = f.read()
+ # Verify PEM Pre-Encapsulation Boundary
+ r = re.compile(r"\s*-----BEGIN (.*)-----\s+")
+ m = r.match(pem_data)
+ if not m:
+ raise ValueError("Not a valid PEM pre boundary")
+ pem_header = m.group(1)
+ if pem_header == 'RSA PRIVATE KEY':
+ self.private_key = RSA.importKey(pem_data, self.private_key_passphrase)
+ elif pem_header == 'EC PRIVATE KEY':
+ self.private_key = ECC.import_key(pem_data, self.private_key_passphrase)
+ elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}:
+ # Key is in PKCS8 format, which is capable of holding many different
+ # types of private keys, not just EC keys.
+ (key_binary, pem_header, is_encrypted) = \
+ PEM.decode(pem_data, self.private_key_passphrase)
+ (oid, privkey, params) = \
+ PKCS8.unwrap(key_binary, passphrase=self.private_key_passphrase)
+ if oid == '1.2.840.10045.2.1':
+ self.private_key = ECC.import_key(pem_data, self.private_key_passphrase)
+ else:
+ raise Exception("Unsupported key: {0}. OID: {1}".format(pem_header, oid))
+ else:
+ raise Exception("Unsupported key: {0}".format(pem_header))
+ # Validate the specified signature algorithm is compatible with the private key.
+ if self.signing_algorithm is not None:
+ supported_algs = None
+ if isinstance(self.private_key, RSA.RsaKey):
+ supported_algs = {ALGORITHM_RSASSA_PSS, ALGORITHM_RSASSA_PKCS1v15}
+ elif isinstance(self.private_key, ECC.EccKey):
+ supported_algs = ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS
+ if supported_algs is not None and self.signing_algorithm not in supported_algs:
+ raise Exception(
+ "Signing algorithm {0} is not compatible with private key".format(
+ self.signing_algorithm))
+
+ def _get_signed_header_info(self, resource_path, method, headers, body, query_params):
+ """Build the HTTP headers (name, value) that need to be included in
+ the HTTP signature scheme.
+
+ :param resource_path : A string representation of the HTTP request resource path.
+ :param method: A string representation of the HTTP request method, e.g. GET, POST.
+ :param headers: A dict containing the HTTP request headers.
+ :param body: The object (e.g. a dict) representing the HTTP request body.
+ :param query_params: A string representing the HTTP request query parameters.
+ :return: A tuple containing two dict objects:
+ The first dict contains the HTTP headers that are used to calculate
+ the HTTP signature.
+ The second dict contains the HTTP headers that must be added to
+ the outbound HTTP request.
+ """
+
+ if body is None:
+ body = ''
+ else:
+ body = body.to_json()
+
+ # Build the '(request-target)' HTTP signature parameter.
+ target_host = urlparse(self.host).netloc
+ target_path = urlparse(self.host).path
+ request_target = method.lower() + " " + target_path + resource_path
+ if query_params:
+ request_target += "?" + urlencode(query_params)
+
+ # Get UNIX time, e.g. seconds since epoch, not including leap seconds.
+ now = time()
+ # Format date per RFC 7231 section-7.1.1.2. An example is:
+ # Date: Wed, 21 Oct 2015 07:28:00 GMT
+ cdate = formatdate(timeval=now, localtime=False, usegmt=True)
+ # The '(created)' value MUST be a Unix timestamp integer value.
+ # Subsecond precision is not supported.
+ created = int(now)
+ if self.signature_max_validity is not None:
+ expires = now + self.signature_max_validity.total_seconds()
+
+ signed_headers_list = []
+ request_headers_dict = {}
+ for hdr_key in self.signed_headers:
+ hdr_key = hdr_key.lower()
+ if hdr_key == HEADER_REQUEST_TARGET:
+ value = request_target
+ elif hdr_key == HEADER_CREATED:
+ value = '{0}'.format(created)
+ elif hdr_key == HEADER_EXPIRES:
+ value = '{0}'.format(expires)
+ elif hdr_key == HEADER_DATE.lower():
+ value = cdate
+ request_headers_dict[HEADER_DATE] = '{0}'.format(cdate)
+ elif hdr_key == HEADER_DIGEST.lower():
+ request_body = body.encode()
+ body_digest, digest_prefix = self._get_message_digest(request_body)
+ b64_body_digest = b64encode(body_digest.digest())
+ value = digest_prefix + b64_body_digest.decode('ascii')
+ request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format(
+ digest_prefix, b64_body_digest.decode('ascii'))
+ elif hdr_key == HEADER_HOST.lower():
+ value = target_host
+ request_headers_dict[HEADER_HOST] = '{0}'.format(target_host)
+ else:
+ value = next((v for k, v in headers.items() if k.lower() == hdr_key), None)
+ if value is None:
+ raise Exception(
+ "Cannot sign HTTP request. "
+ "Request does not contain the '{0}' header".format(hdr_key))
+ signed_headers_list.append((hdr_key, value))
+
+ return signed_headers_list, request_headers_dict
+
+ def _get_message_digest(self, data):
+ """Calculates and returns a cryptographic digest of a specified HTTP request.
+
+ :param data: The string representation of the date to be hashed with a cryptographic hash.
+ :return: A tuple of (digest, prefix).
+ The digest is a hashing object that contains the cryptographic digest of
+ the HTTP request.
+ The prefix is a string that identifies the cryptographic hash. It is used
+ to generate the 'Digest' header as specified in RFC 3230.
+ """
+ if self.hash_algorithm == HASH_SHA512:
+ digest = SHA512.new()
+ prefix = 'SHA-512='
+ elif self.hash_algorithm == HASH_SHA256:
+ digest = SHA256.new()
+ prefix = 'SHA-256='
+ else:
+ raise Exception("Unsupported hash algorithm: {0}".format(self.hash_algorithm))
+ digest.update(data)
+ return digest, prefix
+
+ def _sign_digest(self, digest):
+ """Signs a message digest with a private key specified in the signing_info.
+
+ :param digest: A hashing object that contains the cryptographic digest of the HTTP request.
+ :return: A base-64 string representing the cryptographic signature of the input digest.
+ """
+ sig_alg = self.signing_algorithm
+ if isinstance(self.private_key, RSA.RsaKey):
+ if sig_alg is None or sig_alg == ALGORITHM_RSASSA_PSS:
+ # RSASSA-PSS in Section 8.1 of RFC8017.
+ signature = pss.new(self.private_key).sign(digest)
+ elif sig_alg == ALGORITHM_RSASSA_PKCS1v15:
+ # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017.
+ signature = PKCS1_v1_5.new(self.private_key).sign(digest)
+ else:
+ raise Exception("Unsupported signature algorithm: {0}".format(sig_alg))
+ elif isinstance(self.private_key, ECC.EccKey):
+ if sig_alg is None:
+ sig_alg = ALGORITHM_ECDSA_MODE_FIPS_186_3
+ if sig_alg in ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS:
+ # draft-ietf-httpbis-message-signatures-00 does not specify the ECDSA encoding.
+ # Issue: https://github.com/w3c-ccg/http-signatures/issues/107
+ signature = DSS.new(key=self.private_key, mode=sig_alg,
+ encoding='der').sign(digest)
+ else:
+ raise Exception("Unsupported signature algorithm: {0}".format(sig_alg))
+ else:
+ raise Exception("Unsupported private key: {0}".format(type(self.private_key)))
+ return b64encode(signature)
+
+ def _get_authorization_header(self, signed_headers, signed_msg):
+ """Calculates and returns the value of the 'Authorization' header when signing HTTP requests.
+
+ :param signed_headers : A list of tuples. Each value is the name of a HTTP header that
+ must be included in the HTTP signature calculation.
+ :param signed_msg: A base-64 encoded string representation of the signature.
+ :return: The string value of the 'Authorization' header, representing the signature
+ of the HTTP request.
+ """
+ created_ts = None
+ expires_ts = None
+ for k, v in signed_headers:
+ if k == HEADER_CREATED:
+ created_ts = v
+ elif k == HEADER_EXPIRES:
+ expires_ts = v
+ lower_keys = [k.lower() for k, v in signed_headers]
+ headers_value = " ".join(lower_keys)
+
+ auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\",".format(
+ self.key_id, self.signing_scheme)
+ if created_ts is not None:
+ auth_str = auth_str + "created={0},".format(created_ts)
+ if expires_ts is not None:
+ auth_str = auth_str + "expires={0},".format(expires_ts)
+ auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format(
+ headers_value, signed_msg.decode('ascii'))
+
+ return auth_str
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/test-requirements.mustache
new file mode 100644
index 00000000000..ca8eb277004
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/test-requirements.mustache
@@ -0,0 +1,6 @@
+pytest~=7.1.3
+pytest-cov>=2.8.1
+pytest-randomly>=3.12.0
+{{#hasHttpSignatureMethods}}
+pycryptodome>=3.9.0
+{{/hasHttpSignatureMethods}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/tornado/rest.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/tornado/rest.mustache
new file mode 100644
index 00000000000..59f14ffab1e
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/tornado/rest.mustache
@@ -0,0 +1,223 @@
+# coding: utf-8
+
+{{>partial_header}}
+
+import io
+import json
+import logging
+import re
+
+from urllib.parse import urlencode, quote_plus
+import tornado
+import tornado.gen
+from tornado import httpclient
+from urllib3.filepost import encode_multipart_formdata
+
+from {{packageName}}.exceptions import ApiException, ApiValueError
+
+logger = logging.getLogger(__name__)
+
+
+class RESTResponse(io.IOBase):
+
+ def __init__(self, resp):
+ self.tornado_response = resp
+ self.status = resp.code
+ self.reason = resp.reason
+
+ if resp.body:
+ self.data = resp.body
+ else:
+ self.data = None
+
+ def getheaders(self):
+ """Returns a CIMultiDictProxy of the response headers."""
+ return self.tornado_response.headers
+
+ def getheader(self, name, default=None):
+ """Returns a given response header."""
+ return self.tornado_response.headers.get(name, default)
+
+
+class RESTClientObject(object):
+
+ def __init__(self, configuration, pools_size=4, maxsize=4):
+ # maxsize is number of requests to host that are allowed in parallel
+
+ self.ca_certs = configuration.ssl_ca_cert
+ self.client_key = configuration.key_file
+ self.client_cert = configuration.cert_file
+
+ self.proxy_port = self.proxy_host = None
+
+ # https pool manager
+ if configuration.proxy:
+ self.proxy_port = 80
+ self.proxy_host = configuration.proxy
+
+ self.pool_manager = httpclient.AsyncHTTPClient()
+
+ @tornado.gen.coroutine
+ def request(self, method, url, query_params=None, headers=None, body=None,
+ post_params=None, _preload_content=True,
+ _request_timeout=None):
+ """Execute Request
+
+ :param method: http request method
+ :param url: http request url
+ :param query_params: query parameters in the url
+ :param headers: http request headers
+ :param body: request json body, for `application/json`
+ :param post_params: request post parameters,
+ `application/x-www-form-urlencoded`
+ and `multipart/form-data`
+ :param _preload_content: this is a non-applicable field for
+ the AiohttpClient.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ """
+ method = method.upper()
+ assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
+ 'PATCH', 'OPTIONS']
+
+ if post_params and body:
+ raise ApiValueError(
+ "body parameter cannot be used with post_params parameter."
+ )
+
+ request = httpclient.HTTPRequest(url)
+ request.allow_nonstandard_methods = True
+ request.ca_certs = self.ca_certs
+ request.client_key = self.client_key
+ request.client_cert = self.client_cert
+ request.proxy_host = self.proxy_host
+ request.proxy_port = self.proxy_port
+ request.method = method
+ if headers:
+ request.headers = headers
+ if 'Content-Type' not in headers:
+ request.headers['Content-Type'] = 'application/json'
+ request.request_timeout = _request_timeout or 5 * 60
+
+ post_params = post_params or {}
+
+ if query_params:
+ request.url += '?' + urlencode(query_params)
+
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
+ if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
+ if re.search('json', headers['Content-Type'], re.IGNORECASE):
+ if body:
+ body = json.dumps(body)
+ request.body = body
+ elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
+ request.body = urlencode(post_params)
+ elif headers['Content-Type'] == 'multipart/form-data':
+ multipart = encode_multipart_formdata(post_params)
+ request.body, headers['Content-Type'] = multipart
+ # Pass a `bytes` parameter directly in the body to support
+ # other content types than Json when `body` argument is provided
+ # in serialized form
+ elif isinstance(body, bytes):
+ request.body = body
+ else:
+ # Cannot generate the request from given parameters
+ msg = """Cannot prepare a request message for provided
+ arguments. Please check that your arguments match
+ declared content type."""
+ raise ApiException(status=0, reason=msg)
+
+ r = yield self.pool_manager.fetch(request, raise_error=False)
+
+ if _preload_content:
+
+ r = RESTResponse(r)
+
+ # log response body
+ logger.debug("response body: %s", r.data)
+
+ if not 200 <= r.status <= 299:
+ raise ApiException(http_resp=r)
+
+ raise tornado.gen.Return(r)
+
+ @tornado.gen.coroutine
+ def GET(self, url, headers=None, query_params=None, _preload_content=True,
+ _request_timeout=None):
+ result = yield self.request("GET", url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params)
+ raise tornado.gen.Return(result)
+
+ @tornado.gen.coroutine
+ def HEAD(self, url, headers=None, query_params=None, _preload_content=True,
+ _request_timeout=None):
+ result = yield self.request("HEAD", url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params)
+ raise tornado.gen.Return(result)
+
+ @tornado.gen.coroutine
+ def OPTIONS(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ result = yield self.request("OPTIONS", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ raise tornado.gen.Return(result)
+
+ @tornado.gen.coroutine
+ def DELETE(self, url, headers=None, query_params=None, body=None,
+ _preload_content=True, _request_timeout=None):
+ result = yield self.request("DELETE", url,
+ headers=headers,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ raise tornado.gen.Return(result)
+
+ @tornado.gen.coroutine
+ def POST(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ result = yield self.request("POST", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ raise tornado.gen.Return(result)
+
+ @tornado.gen.coroutine
+ def PUT(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ result = yield self.request("PUT", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ raise tornado.gen.Return(result)
+
+ @tornado.gen.coroutine
+ def PATCH(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ result = yield self.request("PATCH", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ raise tornado.gen.Return(result)
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/tox.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/tox.mustache
new file mode 100644
index 00000000000..9d717c3dd20
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/tox.mustache
@@ -0,0 +1,9 @@
+[tox]
+envlist = py3
+
+[testenv]
+deps=-r{toxinidir}/requirements.txt
+ -r{toxinidir}/test-requirements.txt
+
+commands=
+ pytest --cov={{{packageName}}}
diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/travis.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/travis.mustache
new file mode 100644
index 00000000000..53cb57e845d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python-nextgen/travis.mustache
@@ -0,0 +1,17 @@
+# ref: https://docs.travis-ci.com/user/languages/python
+language: python
+python:
+ - "3.7"
+ - "3.8"
+ - "3.9"
+ - "3.10"
+ - "3.11"
+ # uncomment the following if needed
+ #- "3.11-dev" # 3.11 development branch
+ #- "nightly" # nightly build
+# command to install dependencies
+install:
+ - "pip install -r requirements.txt"
+ - "pip install -r test-requirements.txt"
+# command to run tests
+script: pytest --cov={{{packageName}}}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java
index fa506e4c08b..3af8b16d51b 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java
@@ -255,7 +255,7 @@ public class PythonLegacyClientCodegenTest {
final CodegenProperty property1 = cm.vars.get(0);
Assert.assertEquals(property1.baseName, "translations");
- Assert.assertEquals(property1.dataType, "dict(str, str)");
+ Assert.assertEquals(property1.dataType, "dict[str, str]");
Assert.assertEquals(property1.name, "translations");
Assert.assertEquals(property1.baseType, "dict");
Assert.assertEquals(property1.containerType, "map");
@@ -335,7 +335,7 @@ public class PythonLegacyClientCodegenTest {
final CodegenProperty property1 = cm.vars.get(0);
Assert.assertEquals(property1.baseName, "children");
Assert.assertEquals(property1.complexType, "Children");
- Assert.assertEquals(property1.dataType, "dict(str, Children)");
+ Assert.assertEquals(property1.dataType, "dict[str, Children]");
Assert.assertEquals(property1.name, "children");
Assert.assertEquals(property1.baseType, "dict");
Assert.assertEquals(property1.containerType, "map");
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonNextgenClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonNextgenClientCodegenTest.java
new file mode 100644
index 00000000000..2e603685ee2
--- /dev/null
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonNextgenClientCodegenTest.java
@@ -0,0 +1,385 @@
+/*
+ * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
+ * Copyright 2018 SmartBear Software
+ *
+ * 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.
+ */
+
+package org.openapitools.codegen.python;
+
+import com.google.common.collect.Sets;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.Operation;
+import io.swagger.v3.oas.models.media.*;
+import io.swagger.v3.parser.util.SchemaTypeUtil;
+import org.openapitools.codegen.*;
+import org.openapitools.codegen.languages.PythonNextgenClientCodegen;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+public class PythonNextgenClientCodegenTest {
+
+ @Test
+ public void testInitialConfigValues() throws Exception {
+ final PythonNextgenClientCodegen codegen = new PythonNextgenClientCodegen();
+ codegen.processOpts();
+
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE);
+ Assert.assertEquals(codegen.isHideGenerationTimestamp(), true);
+ }
+
+ @Test
+ public void testSettersForConfigValues() throws Exception {
+ final PythonNextgenClientCodegen codegen = new PythonNextgenClientCodegen();
+ codegen.setHideGenerationTimestamp(false);
+ codegen.processOpts();
+
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE);
+ Assert.assertEquals(codegen.isHideGenerationTimestamp(), false);
+ }
+
+ @Test
+ public void testAdditionalPropertiesPutForConfigValues() throws Exception {
+ final PythonNextgenClientCodegen codegen = new PythonNextgenClientCodegen();
+ codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false);
+ codegen.processOpts();
+
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE);
+ Assert.assertEquals(codegen.isHideGenerationTimestamp(), false);
+ }
+
+ @Test(description = "test enum null/nullable patterns")
+ public void testEnumNull() {
+ final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_1997.yaml");
+
+ StringSchema prop = (StringSchema) openAPI.getComponents().getSchemas().get("Type").getProperties().get("prop");
+ ArrayList expected = new ArrayList<>(Arrays.asList("A", "B", "C"));
+ assert prop.getNullable();
+ assert prop.getEnum().equals(expected);
+ }
+
+ @Test(description = "test regex patterns")
+ public void testRegularExpressionOpenAPISchemaVersion3() {
+ final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_1517.yaml");
+ final PythonNextgenClientCodegen codegen = new PythonNextgenClientCodegen();
+ codegen.setOpenAPI(openAPI);
+ final String path = "/ping";
+ final Operation p = openAPI.getPaths().get(path).getGet();
+ final CodegenOperation op = codegen.fromOperation(path, "get", p, null);
+ // pattern_no_forward_slashes '^pattern$'
+ Assert.assertEquals(op.allParams.get(0).pattern, "/^pattern$/");
+ // pattern_two_slashes '/^pattern$/'
+ Assert.assertEquals(op.allParams.get(1).pattern, "/^pattern$/");
+ // pattern_dont_escape_backslash '/^pattern\d{3}$/'
+ Assert.assertEquals(op.allParams.get(2).pattern, "/^pattern\\d{3}$/");
+ // pattern_dont_escape_escaped_forward_slash '/^pattern\/\d{3}$/'
+ Assert.assertEquals(op.allParams.get(3).pattern, "/^pattern\\/\\d{3}$/");
+ // pattern_escape_unescaped_forward_slash '^pattern/\d{3}$'
+ Assert.assertEquals(op.allParams.get(4).pattern, "/^pattern\\/\\d{3}$/");
+ // pattern_with_modifiers '/^pattern\d{3}$/i
+ Assert.assertEquals(op.allParams.get(5).pattern, "/^pattern\\d{3}$/i");
+ // pattern_with_backslash_after_bracket '/^[\pattern\d{3}$/i'
+ // added to test fix for issue #6675
+ // removed because "/^[\\pattern\\d{3}$/i" is invalid regex because [ is not escaped and there is no closing ]
+ // Assert.assertEquals(op.allParams.get(6).pattern, "/^[\\pattern\\d{3}$/i");
+
+ }
+
+
+ @Test(description = "test generated example values for string properties")
+ public void testGeneratedExampleValues() {
+ final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml");
+ final PythonNextgenClientCodegen codegen = new PythonNextgenClientCodegen();
+ codegen.setOpenAPI(openAPI);
+ final Schema dummyUserSchema = openAPI.getComponents().getSchemas().get("DummyUser");
+ final Schema nameSchema = (Schema) dummyUserSchema.getProperties().get("name");
+ final Schema numberSchema = (Schema) dummyUserSchema.getProperties().get("number");
+ final Schema addressSchema = (Schema) dummyUserSchema.getProperties().get("address");
+ final String namePattern = codegen.patternCorrection(nameSchema.getPattern());
+ final String numberPattern = codegen.patternCorrection(numberSchema.getPattern());
+ final String addressPattern = codegen.patternCorrection(addressSchema.getPattern());
+ Assert.assertTrue(codegen.escapeQuotationMark(codegen.toExampleValue(nameSchema)).matches(namePattern));
+ Assert.assertTrue(codegen.escapeQuotationMark(codegen.toExampleValue(numberSchema)).matches(numberPattern));
+ Assert.assertTrue(codegen.escapeQuotationMark(codegen.toExampleValue(addressSchema)).matches(addressPattern));
+ }
+
+ @Test(description = "test single quotes escape")
+ public void testSingleQuotes() {
+ final PythonNextgenClientCodegen codegen = new PythonNextgenClientCodegen();
+ StringSchema schema = new StringSchema();
+ schema.setDefault("Text containing 'single' quote");
+ String defaultValue = codegen.toDefaultValue(schema);
+ Assert.assertEquals("'Text containing \'single\' quote'", defaultValue);
+ }
+
+ @Test(description = "convert a python model with dots")
+ public void modelTest() {
+ final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/v1beta3.json");
+ final DefaultCodegen codegen = new PythonNextgenClientCodegen();
+ codegen.setOpenAPI(openAPI);
+
+ codegen.setOpenAPI(openAPI);
+ final CodegenModel simpleName = codegen.fromModel("v1beta3.Binding", openAPI.getComponents().getSchemas().get("v1beta3.Binding"));
+ Assert.assertEquals(simpleName.name, "v1beta3.Binding");
+ Assert.assertEquals(simpleName.classname, "V1beta3Binding");
+ Assert.assertEquals(simpleName.classVarName, "v1beta3_binding");
+
+ codegen.setOpenAPI(openAPI);
+ final CodegenModel compoundName = codegen.fromModel("v1beta3.ComponentStatus", openAPI.getComponents().getSchemas().get("v1beta3.ComponentStatus"));
+ Assert.assertEquals(compoundName.name, "v1beta3.ComponentStatus");
+ Assert.assertEquals(compoundName.classname, "V1beta3ComponentStatus");
+ Assert.assertEquals(compoundName.classVarName, "v1beta3_component_status");
+
+ final String path = "/api/v1beta3/namespaces/{namespaces}/bindings";
+ final Operation operation = openAPI.getPaths().get(path).getPost();
+ final CodegenOperation codegenOperation = codegen.fromOperation(path, "get", operation, null);
+ Assert.assertEquals(codegenOperation.returnType, "V1beta3Binding");
+ Assert.assertEquals(codegenOperation.returnBaseType, "V1beta3Binding");
+ }
+
+ @Test(description = "convert a simple java model")
+ public void simpleModelTest() {
+ final Schema schema = new Schema()
+ .description("a sample model")
+ .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT))
+ .addProperties("name", new StringSchema())
+ .addProperties("createdAt", new DateTimeSchema())
+ .addRequiredItem("id")
+ .addRequiredItem("name");
+ final DefaultCodegen codegen = new PythonNextgenClientCodegen();
+ OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema);
+ codegen.setOpenAPI(openAPI);
+ final CodegenModel cm = codegen.fromModel("sample", schema);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "a sample model");
+ Assert.assertEquals(cm.vars.size(), 3);
+
+ final CodegenProperty property1 = cm.vars.get(0);
+ Assert.assertEquals(property1.baseName, "id");
+ Assert.assertEquals(property1.dataType, "int");
+ Assert.assertEquals(property1.name, "id");
+ Assert.assertNull(property1.defaultValue);
+ Assert.assertEquals(property1.baseType, "int");
+ Assert.assertTrue(property1.required);
+ Assert.assertTrue(property1.isPrimitiveType);
+
+ final CodegenProperty property2 = cm.vars.get(1);
+ Assert.assertEquals(property2.baseName, "name");
+ Assert.assertEquals(property2.dataType, "str");
+ Assert.assertEquals(property2.name, "name");
+ Assert.assertNull(property2.defaultValue);
+ Assert.assertEquals(property2.baseType, "str");
+ Assert.assertTrue(property2.required);
+ Assert.assertTrue(property2.isPrimitiveType);
+
+ final CodegenProperty property3 = cm.vars.get(2);
+ Assert.assertEquals(property3.baseName, "createdAt");
+ Assert.assertEquals(property3.dataType, "datetime");
+ Assert.assertEquals(property3.name, "created_at");
+ Assert.assertNull(property3.defaultValue);
+ Assert.assertEquals(property3.baseType, "datetime");
+ Assert.assertFalse(property3.required);
+ }
+
+ @Test(description = "convert a model with list property")
+ public void listPropertyTest() {
+ final Schema model = new Schema()
+ .description("a sample model")
+ .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT))
+ .addProperties("urls", new ArraySchema()
+ .items(new StringSchema()))
+ .addRequiredItem("id");
+ final DefaultCodegen codegen = new PythonNextgenClientCodegen();
+ OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
+ codegen.setOpenAPI(openAPI);
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "a sample model");
+ Assert.assertEquals(cm.vars.size(), 2);
+
+ final CodegenProperty property1 = cm.vars.get(0);
+ Assert.assertEquals(property1.baseName, "id");
+ Assert.assertEquals(property1.dataType, "int");
+ Assert.assertEquals(property1.name, "id");
+ Assert.assertNull(property1.defaultValue);
+ Assert.assertEquals(property1.baseType, "int");
+ Assert.assertTrue(property1.required);
+ Assert.assertTrue(property1.isPrimitiveType);
+
+ final CodegenProperty property2 = cm.vars.get(1);
+ Assert.assertEquals(property2.baseName, "urls");
+ Assert.assertEquals(property2.dataType, "List[str]");
+ Assert.assertEquals(property2.name, "urls");
+ Assert.assertNull(property2.defaultValue);
+ Assert.assertEquals(property2.baseType, "List");
+ Assert.assertEquals(property2.containerType, "array");
+ Assert.assertFalse(property2.required);
+ Assert.assertTrue(property2.isPrimitiveType);
+ Assert.assertTrue(property2.isContainer);
+ }
+
+ @Test(description = "convert a model with a map property")
+ public void mapPropertyTest() {
+ final Schema model = new Schema()
+ .description("a sample model")
+ .addProperties("translations", new MapSchema()
+ .additionalProperties(new StringSchema()))
+ .addRequiredItem("id");
+ final DefaultCodegen codegen = new PythonNextgenClientCodegen();
+ OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
+ codegen.setOpenAPI(openAPI);
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "a sample model");
+ Assert.assertEquals(cm.vars.size(), 1);
+
+ final CodegenProperty property1 = cm.vars.get(0);
+ Assert.assertEquals(property1.baseName, "translations");
+ Assert.assertEquals(property1.dataType, "Dict[str, str]");
+ Assert.assertEquals(property1.name, "translations");
+ Assert.assertEquals(property1.baseType, "Dict");
+ Assert.assertEquals(property1.containerType, "map");
+ Assert.assertFalse(property1.required);
+ Assert.assertTrue(property1.isContainer);
+ Assert.assertTrue(property1.isPrimitiveType);
+ }
+
+ @Test(description = "convert a model with complex property")
+ public void complexPropertyTest() {
+ final Schema model = new Schema()
+ .description("a sample model")
+ .addProperties("children", new Schema().$ref("#/definitions/Children"));
+ final DefaultCodegen codegen = new PythonNextgenClientCodegen();
+ OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
+ codegen.setOpenAPI(openAPI);
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "a sample model");
+ Assert.assertEquals(cm.vars.size(), 1);
+
+ final CodegenProperty property1 = cm.vars.get(0);
+ Assert.assertEquals(property1.baseName, "children");
+ Assert.assertEquals(property1.dataType, "Children");
+ Assert.assertEquals(property1.name, "children");
+ Assert.assertEquals(property1.baseType, "Children");
+ Assert.assertFalse(property1.required);
+ Assert.assertFalse(property1.isContainer);
+ }
+
+ @Test(description = "convert a model with complex list property")
+ public void complexListPropertyTest() {
+ final Schema model = new Schema()
+ .description("a sample model")
+ .addProperties("children", new ArraySchema()
+ .items(new Schema().$ref("#/definitions/Children")));
+ final DefaultCodegen codegen = new PythonNextgenClientCodegen();
+ OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
+ codegen.setOpenAPI(openAPI);
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "a sample model");
+ Assert.assertEquals(cm.vars.size(), 1);
+
+ final CodegenProperty property1 = cm.vars.get(0);
+ Assert.assertEquals(property1.baseName, "children");
+ Assert.assertEquals(property1.complexType, "Children");
+ Assert.assertEquals(property1.dataType, "List[Children]");
+ Assert.assertEquals(property1.name, "children");
+ Assert.assertEquals(property1.baseType, "List");
+ Assert.assertEquals(property1.containerType, "array");
+ Assert.assertFalse(property1.required);
+ Assert.assertTrue(property1.isContainer);
+ }
+
+ @Test(description = "convert a model with complex map property")
+ public void complexMapPropertyTest() {
+ final Schema model = new Schema()
+ .description("a sample model")
+ .addProperties("children", new MapSchema()
+ .additionalProperties(new Schema().$ref("#/definitions/Children")));
+ final DefaultCodegen codegen = new PythonNextgenClientCodegen();
+ OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
+ codegen.setOpenAPI(openAPI);
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "a sample model");
+ Assert.assertEquals(cm.vars.size(), 1);
+ Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1);
+
+ final CodegenProperty property1 = cm.vars.get(0);
+ Assert.assertEquals(property1.baseName, "children");
+ Assert.assertEquals(property1.complexType, "Children");
+ Assert.assertEquals(property1.dataType, "Dict[str, Children]");
+ Assert.assertEquals(property1.name, "children");
+ Assert.assertEquals(property1.baseType, "Dict");
+ Assert.assertEquals(property1.containerType, "map");
+ Assert.assertFalse(property1.required);
+ Assert.assertTrue(property1.isContainer);
+ }
+
+
+ // should not start with 'null'. need help from the community to investigate further
+ @Test(description = "convert an array model")
+ public void arrayModelTest() {
+ final Schema model = new ArraySchema()
+ //.description()
+ .items(new Schema().$ref("#/definitions/Children"))
+ .description("an array model");
+ final DefaultCodegen codegen = new PythonNextgenClientCodegen();
+ OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
+ codegen.setOpenAPI(openAPI);
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "an array model");
+ Assert.assertEquals(cm.vars.size(), 0);
+ Assert.assertEquals(cm.parent, "null");
+ Assert.assertEquals(cm.imports.size(), 1);
+ Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1);
+ }
+
+ // should not start with 'null'. need help from the community to investigate further
+ @Test(description = "convert a map model")
+ public void mapModelTest() {
+ final Schema model = new Schema()
+ .description("a map model")
+ .additionalProperties(new Schema().$ref("#/definitions/Children"));
+ final DefaultCodegen codegen = new PythonNextgenClientCodegen();
+ OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
+ codegen.setOpenAPI(openAPI);
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "a map model");
+ Assert.assertEquals(cm.vars.size(), 0);
+ Assert.assertEquals(cm.parent, null);
+ Assert.assertEquals(cm.imports.size(), 0);
+ }
+}
diff --git a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml
new file mode 100644
index 00000000000..2ebb657985b
--- /dev/null
+++ b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml
@@ -0,0 +1,2018 @@
+openapi: 3.0.0
+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: "
+ \
+ version: 1.0.0
+ title: OpenAPI Petstore
+ license:
+ name: Apache-2.0
+ url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
+tags:
+ - name: pet
+ description: Everything about your Pets
+ - name: store
+ description: Access to Petstore orders
+ - name: user
+ description: Operations about user
+paths:
+ /foo:
+ get:
+ responses:
+ default:
+ description: response
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ string:
+ $ref: '#/components/schemas/Foo'
+ /pet:
+ post:
+ tags:
+ - pet
+ summary: Add a new pet to the store
+ description: ''
+ operationId: addPet
+ responses:
+ '200':
+ description: Successful operation
+ '405':
+ description: Invalid input
+ security:
+ - http_signature_test: []
+ - petstore_auth:
+ - 'write:pets'
+ - 'read:pets'
+ requestBody:
+ $ref: '#/components/requestBodies/Pet'
+ put:
+ tags:
+ - pet
+ summary: Update an existing pet
+ description: ''
+ operationId: updatePet
+ x-webclient-blocking: true
+ responses:
+ '200':
+ description: Successful operation
+ '400':
+ description: Invalid ID supplied
+ '404':
+ description: Pet not found
+ '405':
+ description: Validation exception
+ security:
+ - http_signature_test: []
+ - petstore_auth:
+ - 'write:pets'
+ - 'read:pets'
+ requestBody:
+ $ref: '#/components/requestBodies/Pet'
+ /pet/findByStatus:
+ get:
+ tags:
+ - pet
+ summary: Finds Pets by status
+ description: Multiple status values can be provided with comma separated strings
+ operationId: findPetsByStatus
+ x-webclient-blocking: true
+ parameters:
+ - name: status
+ in: query
+ description: Status values that need to be considered for filter
+ required: true
+ style: form
+ explode: false
+ deprecated: true
+ schema:
+ type: array
+ items:
+ type: string
+ enum:
+ - available
+ - pending
+ - sold
+ default: available
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/xml:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Pet'
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Pet'
+ '400':
+ description: Invalid status value
+ security:
+ - http_signature_test: []
+ - petstore_auth:
+ - 'write:pets'
+ - 'read:pets'
+ /pet/findByTags:
+ get:
+ tags:
+ - pet
+ summary: Finds Pets by tags
+ description: >-
+ Multiple tags can be provided with comma separated strings. Use tag1,
+ tag2, tag3 for testing.
+ operationId: findPetsByTags
+ x-webclient-blocking: true
+ parameters:
+ - name: tags
+ in: query
+ description: Tags to filter by
+ required: true
+ style: form
+ explode: false
+ schema:
+ type: array
+ items:
+ type: string
+ uniqueItems: true
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/xml:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Pet'
+ uniqueItems: true
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Pet'
+ uniqueItems: true
+ '400':
+ description: Invalid tag value
+ security:
+ - http_signature_test: []
+ - petstore_auth:
+ - 'write:pets'
+ - 'read:pets'
+ deprecated: true
+ '/pet/{petId}':
+ get:
+ tags:
+ - pet
+ summary: Find pet by ID
+ description: Returns a single pet
+ operationId: getPetById
+ x-webclient-blocking: true
+ parameters:
+ - name: petId
+ in: path
+ description: ID of pet to return
+ required: true
+ schema:
+ type: integer
+ format: int64
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ '400':
+ description: Invalid ID supplied
+ '404':
+ description: Pet not found
+ security:
+ - api_key: []
+ post:
+ tags:
+ - pet
+ summary: Updates a pet in the store with form data
+ description: ''
+ operationId: updatePetWithForm
+ parameters:
+ - name: petId
+ in: path
+ description: ID of pet that needs to be updated
+ required: true
+ schema:
+ type: integer
+ format: int64
+ responses:
+ '200':
+ description: Successful operation
+ '405':
+ description: Invalid input
+ security:
+ - petstore_auth:
+ - 'write:pets'
+ - 'read:pets'
+ requestBody:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ type: object
+ properties:
+ name:
+ description: Updated name of the pet
+ type: string
+ status:
+ description: Updated status of the pet
+ type: string
+ delete:
+ tags:
+ - pet
+ summary: Deletes a pet
+ description: ''
+ operationId: deletePet
+ parameters:
+ - name: api_key
+ in: header
+ required: false
+ schema:
+ type: string
+ - name: petId
+ in: path
+ description: Pet id to delete
+ required: true
+ schema:
+ type: integer
+ format: int64
+ responses:
+ '200':
+ description: Successful operation
+ '400':
+ description: Invalid pet value
+ security:
+ - petstore_auth:
+ - 'write:pets'
+ - 'read:pets'
+ '/pet/{petId}/uploadImage':
+ post:
+ tags:
+ - pet
+ summary: uploads an image
+ description: ''
+ operationId: uploadFile
+ parameters:
+ - name: petId
+ in: path
+ description: ID of pet to update
+ required: true
+ schema:
+ type: integer
+ format: int64
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiResponse'
+ security:
+ - petstore_auth:
+ - 'write:pets'
+ - 'read:pets'
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ additionalMetadata:
+ description: Additional data to pass to server
+ type: string
+ file:
+ description: file to upload
+ type: string
+ format: binary
+ /store/inventory:
+ get:
+ tags:
+ - store
+ summary: Returns pet inventories by status
+ description: Returns a map of status codes to quantities
+ operationId: getInventory
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: object
+ additionalProperties:
+ type: integer
+ format: int32
+ security:
+ - api_key: []
+ /store/order:
+ post:
+ tags:
+ - store
+ summary: Place an order for a pet
+ description: ''
+ operationId: placeOrder
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Order'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Order'
+ '400':
+ description: Invalid Order
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Order'
+ description: order placed for purchasing the pet
+ required: true
+ '/store/order/{order_id}':
+ get:
+ tags:
+ - store
+ summary: Find purchase order by ID
+ description: >-
+ For valid response try integer IDs with value <= 5 or > 10. Other values
+ will generated exceptions
+ operationId: getOrderById
+ parameters:
+ - name: order_id
+ in: path
+ description: ID of pet that needs to be fetched
+ required: true
+ schema:
+ type: integer
+ format: int64
+ minimum: 1
+ maximum: 5
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Order'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Order'
+ '400':
+ description: Invalid ID supplied
+ '404':
+ description: Order not found
+ delete:
+ tags:
+ - store
+ summary: Delete purchase order by ID
+ description: >-
+ For valid response try integer IDs with value < 1000. Anything above
+ 1000 or nonintegers will generate API errors
+ operationId: deleteOrder
+ parameters:
+ - name: order_id
+ in: path
+ description: ID of the order that needs to be deleted
+ required: true
+ schema:
+ type: string
+ responses:
+ '400':
+ description: Invalid ID supplied
+ '404':
+ description: Order not found
+ /user:
+ servers:
+ - url: 'http://petstore.swagger.io/v2'
+ - url: 'http://path-server-test.petstore.local/v2'
+ - url: 'http://{server}.swagger.io:{port}/v2'
+ description: test server with variables
+ variables:
+ server:
+ description: target server
+ enum:
+ - 'petstore'
+ - 'qa-petstore'
+ - 'dev-petstore'
+ default: 'petstore'
+ port:
+ enum:
+ - 80
+ - 8080
+ default: 80
+ post:
+ tags:
+ - user
+ summary: Create user
+ description: This can only be done by the logged in user.
+ operationId: createUser
+ responses:
+ default:
+ description: successful operation
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/User'
+ description: Created user object
+ required: true
+ /user/createWithArray:
+ post:
+ tags:
+ - user
+ summary: Creates list of users with given input array
+ description: ''
+ operationId: createUsersWithArrayInput
+ responses:
+ default:
+ description: successful operation
+ requestBody:
+ $ref: '#/components/requestBodies/UserArray'
+ /user/createWithList:
+ post:
+ tags:
+ - user
+ summary: Creates list of users with given input array
+ description: ''
+ operationId: createUsersWithListInput
+ responses:
+ default:
+ description: successful operation
+ requestBody:
+ $ref: '#/components/requestBodies/UserArray'
+ /user/login:
+ get:
+ tags:
+ - user
+ summary: Logs user into the system
+ description: ''
+ operationId: loginUser
+ parameters:
+ - name: username
+ in: query
+ description: The user name for login
+ required: true
+ schema:
+ type: string
+ - name: password
+ in: query
+ description: The password for login in clear text
+ required: true
+ schema:
+ type: string
+ responses:
+ '200':
+ description: successful operation
+ headers:
+ X-Rate-Limit:
+ description: calls per hour allowed by the user
+ schema:
+ type: integer
+ format: int32
+ X-Expires-After:
+ description: date in UTC when token expires
+ schema:
+ type: string
+ format: date-time
+ content:
+ application/xml:
+ schema:
+ type: string
+ application/json:
+ schema:
+ type: string
+ '400':
+ description: Invalid username/password supplied
+ /user/logout:
+ get:
+ tags:
+ - user
+ summary: Logs out current logged in user session
+ description: ''
+ operationId: logoutUser
+ responses:
+ default:
+ description: successful operation
+ '/user/{username}':
+ get:
+ tags:
+ - user
+ summary: Get user by user name
+ description: ''
+ operationId: getUserByName
+ parameters:
+ - name: username
+ in: path
+ description: The name that needs to be fetched. Use user1 for testing.
+ required: true
+ schema:
+ type: string
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/User'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/User'
+ '400':
+ description: Invalid username supplied
+ '404':
+ description: User not found
+ put:
+ tags:
+ - user
+ summary: Updated user
+ description: This can only be done by the logged in user.
+ operationId: updateUser
+ parameters:
+ - name: username
+ in: path
+ description: name that need to be deleted
+ required: true
+ schema:
+ type: string
+ responses:
+ '400':
+ description: Invalid user supplied
+ '404':
+ description: User not found
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/User'
+ description: Updated user object
+ required: true
+ delete:
+ tags:
+ - user
+ summary: Delete user
+ description: This can only be done by the logged in user.
+ operationId: deleteUser
+ parameters:
+ - name: username
+ in: path
+ description: The name that needs to be deleted
+ required: true
+ schema:
+ type: string
+ responses:
+ '400':
+ description: Invalid username supplied
+ '404':
+ description: User not found
+ /fake_classname_test:
+ patch:
+ tags:
+ - 'fake_classname_tags 123#$%^'
+ summary: To test class name in snake case
+ description: To test class name in snake case
+ operationId: testClassname
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Client'
+ security:
+ - api_key_query: []
+ requestBody:
+ $ref: '#/components/requestBodies/Client'
+ /fake:
+ patch:
+ tags:
+ - fake
+ summary: To test "client" model
+ description: To test "client" model
+ operationId: testClientModel
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Client'
+ requestBody:
+ $ref: '#/components/requestBodies/Client'
+ # get:
+ # tags:
+ # - fake
+ # summary: To test enum parameters
+ # description: To test enum parameters
+ # operationId: testEnumParameters
+ # parameters:
+ # - name: enum_header_string_array
+ # in: header
+ # description: Header parameter enum test (string array)
+ # schema:
+ # type: array
+ # items:
+ # type: string
+ # default: $
+ # enum:
+ # - '>'
+ # - $
+ # - name: enum_header_string
+ # in: header
+ # description: Header parameter enum test (string)
+ # schema:
+ # type: string
+ # enum:
+ # - _abc
+ # - '-efg'
+ # - (xyz)
+ # default: '-efg'
+ # - name: enum_query_string_array
+ # in: query
+ # description: Query parameter enum test (string array)
+ # schema:
+ # type: array
+ # items:
+ # type: string
+ # default: $
+ # enum:
+ # - '>'
+ # - $
+ # - name: enum_query_string
+ # in: query
+ # description: Query parameter enum test (string)
+ # schema:
+ # type: string
+ # enum:
+ # - _abc
+ # - '-efg'
+ # - (xyz)
+ # default: '-efg'
+ # - name: enum_query_integer
+ # in: query
+ # description: Query parameter enum test (double)
+ # schema:
+ # type: integer
+ # format: int32
+ # enum:
+ # - 1
+ # - -2
+ # - name: enum_query_double
+ # in: query
+ # description: Query parameter enum test (double)
+ # schema:
+ # type: number
+ # format: double
+ # enum:
+ # - 1.1
+ # - -1.2
+ # #- name: enum_query_model_array
+ # # in: query
+ # # schema:
+ # # type: array
+ # # items:
+ # # $ref: '#/components/schemas/EnumClass'
+ # responses:
+ # '400':
+ # description: Invalid request
+ # '404':
+ # description: Not found
+ # requestBody:
+ # content:
+ # application/x-www-form-urlencoded:
+ # schema:
+ # type: object
+ # properties:
+ # enum_form_string_array:
+ # description: Form parameter enum test (string array)
+ # type: array
+ # items:
+ # type: string
+ # default: $
+ # enum:
+ # - '>'
+ # - $
+ # enum_form_string:
+ # description: Form parameter enum test (string)
+ # type: string
+ # enum:
+ # - _abc
+ # - '-efg'
+ # - (xyz)
+ # default: '-efg'
+ post:
+ tags:
+ - fake
+ summary: |
+ Fake endpoint for testing various parameters
+ 假端點
+ 偽のエンドポイント
+ 가짜 엔드 포인트
+ description: |
+ Fake endpoint for testing various parameters
+ 假端點
+ 偽のエンドポイント
+ 가짜 엔드 포인트
+ operationId: testEndpointParameters
+ responses:
+ '400':
+ description: Invalid username supplied
+ '404':
+ description: User not found
+ security:
+ - http_basic_test: []
+ requestBody:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ type: object
+ properties:
+ integer:
+ description: None
+ type: integer
+ minimum: 10
+ maximum: 100
+ int32:
+ description: None
+ type: integer
+ format: int32
+ minimum: 20
+ maximum: 200
+ int64:
+ description: None
+ type: integer
+ format: int64
+ number:
+ description: None
+ type: number
+ minimum: 32.1
+ maximum: 543.2
+ float:
+ description: None
+ type: number
+ format: float
+ maximum: 987.6
+ double:
+ description: None
+ type: number
+ format: double
+ minimum: 67.8
+ maximum: 123.4
+ string:
+ description: None
+ type: string
+ pattern: '/[a-z]/i'
+ pattern_without_delimiter:
+ description: None
+ type: string
+ pattern: '^[A-Z].*'
+ byte:
+ description: None
+ type: string
+ format: byte
+ binary:
+ description: None
+ type: string
+ format: binary
+ date:
+ description: None
+ type: string
+ format: date
+ dateTime:
+ description: None
+ type: string
+ format: date-time
+ password:
+ description: None
+ type: string
+ format: password
+ minLength: 10
+ maxLength: 64
+ callback:
+ description: None
+ type: string
+ required:
+ - number
+ - double
+ - pattern_without_delimiter
+ - byte
+ delete:
+ tags:
+ - fake
+ security:
+ - bearer_test: []
+ summary: Fake endpoint to test group parameters (optional)
+ description: Fake endpoint to test group parameters (optional)
+ operationId: testGroupParameters
+ x-group-parameters: true
+ parameters:
+ - name: required_string_group
+ in: query
+ description: Required String in group parameters
+ required: true
+ schema:
+ type: integer
+ - name: required_boolean_group
+ in: header
+ description: Required Boolean in group parameters
+ required: true
+ schema:
+ type: boolean
+ - name: required_int64_group
+ in: query
+ description: Required Integer in group parameters
+ required: true
+ schema:
+ type: integer
+ format: int64
+ - name: string_group
+ in: query
+ description: String in group parameters
+ schema:
+ type: integer
+ - name: boolean_group
+ in: header
+ description: Boolean in group parameters
+ schema:
+ type: boolean
+ - name: int64_group
+ in: query
+ description: Integer in group parameters
+ schema:
+ type: integer
+ format: int64
+ responses:
+ '400':
+ description: Someting wrong
+ /fake/outer/number:
+ post:
+ tags:
+ - fake
+ description: Test serialization of outer number types
+ operationId: fakeOuterNumberSerialize
+ responses:
+ '200':
+ description: Output number
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterNumber'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OuterNumber'
+ description: Input number as post body
+ /fake/property/enum-int:
+ post:
+ tags:
+ - fake
+ description: Test serialization of enum (int) properties with examples
+ operationId: fakePropertyEnumIntegerSerialize
+ responses:
+ '200':
+ description: Output enum (int)
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterObjectWithEnumProperty'
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OuterObjectWithEnumProperty'
+ description: Input enum (int) as post body
+ /fake/outer/string:
+ post:
+ tags:
+ - fake
+ description: Test serialization of outer string types
+ operationId: fakeOuterStringSerialize
+ responses:
+ '200':
+ description: Output string
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterString'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OuterString'
+ description: Input string as post body
+ /fake/outer/boolean:
+ post:
+ tags:
+ - fake
+ description: Test serialization of outer boolean types
+ operationId: fakeOuterBooleanSerialize
+ responses:
+ '200':
+ description: Output boolean
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterBoolean'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OuterBoolean'
+ description: Input boolean as post body
+ /fake/outer/composite:
+ post:
+ tags:
+ - fake
+ description: Test serialization of object with outer number type
+ operationId: fakeOuterCompositeSerialize
+ responses:
+ '200':
+ description: Output composite
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterComposite'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OuterComposite'
+ description: Input composite as post body
+ /fake/jsonFormData:
+ get:
+ tags:
+ - fake
+ summary: test json serialization of form data
+ description: ''
+ operationId: testJsonFormData
+ responses:
+ '200':
+ description: successful operation
+ requestBody:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ type: object
+ properties:
+ param:
+ description: field1
+ type: string
+ param2:
+ description: field2
+ type: string
+ required:
+ - param
+ - param2
+ /fake/inline-additionalProperties:
+ post:
+ tags:
+ - fake
+ summary: test inline additionalProperties
+ description: ''
+ operationId: testInlineAdditionalProperties
+ responses:
+ '200':
+ description: successful operation
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ additionalProperties:
+ type: string
+ description: request body
+ required: true
+ /fake/body-with-query-params:
+ put:
+ tags:
+ - fake
+ operationId: testBodyWithQueryParams
+ parameters:
+ - name: query
+ in: query
+ required: true
+ schema:
+ type: string
+ responses:
+ '200':
+ description: Success
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/User'
+ required: true
+ /another-fake/dummy:
+ patch:
+ tags:
+ - $another-fake?
+ summary: To test special tags
+ description: To test special tags and operation ID starting with number
+ operationId: '123_test_@#$%_special_tags'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Client'
+ requestBody:
+ $ref: '#/components/requestBodies/Client'
+ /fake/body-with-file-schema:
+ put:
+ tags:
+ - fake
+ description: >-
+ For this test, the body for this request must reference a schema named
+ `File`.
+ operationId: testBodyWithFileSchema
+ responses:
+ '200':
+ description: Success
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/FileSchemaTestClass'
+ required: true
+ /fake/body-with-binary:
+ put:
+ tags:
+ - fake
+ description: >-
+ For this test, the body has to be a binary file.
+ operationId: testBodyWithBinary
+ responses:
+ '200':
+ description: Success
+ requestBody:
+ content:
+ image/png:
+ schema:
+ type: string
+ nullable: true
+ format: binary
+ description: image to upload
+ required: true
+ /fake/test-query-parameters:
+ put:
+ tags:
+ - fake
+ description: To test the collection format in query parameters
+ operationId: testQueryParameterCollectionFormat
+ parameters:
+ - name: pipe
+ in: query
+ required: true
+ style: pipeDelimited
+ schema:
+ type: array
+ items:
+ type: string
+ - name: ioutil
+ in: query
+ required: true
+ style: form
+ explode: false
+ schema:
+ type: array
+ items:
+ type: string
+ - name: http
+ in: query
+ required: true
+ style: spaceDelimited
+ schema:
+ type: array
+ items:
+ type: string
+ - name: url
+ in: query
+ required: true
+ style: form
+ explode: false
+ schema:
+ type: array
+ items:
+ type: string
+ - name: context
+ in: query
+ required: true
+ explode: true
+ schema:
+ type: array
+ items:
+ type: string
+ - name: language
+ in: query
+ required: false
+ schema:
+ type: object
+ additionalProperties:
+ type: string
+ format: string
+ - name: allowEmpty
+ in: query
+ required: true
+ allowEmptyValue: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ '/fake/{petId}/uploadImageWithRequiredFile':
+ post:
+ tags:
+ - pet
+ summary: uploads an image (required)
+ description: ''
+ operationId: uploadFileWithRequiredFile
+ parameters:
+ - name: petId
+ in: path
+ description: ID of pet to update
+ required: true
+ schema:
+ type: integer
+ format: int64
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiResponse'
+ security:
+ - petstore_auth:
+ - 'write:pets'
+ - 'read:pets'
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ additionalMetadata:
+ description: Additional data to pass to server
+ type: string
+ requiredFile:
+ description: file to upload
+ type: string
+ format: binary
+ required:
+ - requiredFile
+ /fake/health:
+ get:
+ tags:
+ - fake
+ summary: Health check endpoint
+ responses:
+ 200:
+ description: The instance started successfully
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/HealthCheckResult'
+ /fake/http-signature-test:
+ get:
+ tags:
+ - fake
+ summary: test http signature authentication
+ operationId: fake-http-signature-test
+ parameters:
+ - name: query_1
+ in: query
+ description: query parameter
+ required: optional
+ schema:
+ type: string
+ - name: header_1
+ in: header
+ description: header parameter
+ required: optional
+ schema:
+ type: string
+ security:
+ - http_signature_test: []
+ requestBody:
+ $ref: '#/components/requestBodies/Pet'
+ responses:
+ 200:
+ description: The instance started successfully
+servers:
+ - url: 'http://{server}.swagger.io:{port}/v2'
+ description: petstore server
+ variables:
+ server:
+ enum:
+ - 'petstore'
+ - 'qa-petstore'
+ - 'dev-petstore'
+ default: 'petstore'
+ port:
+ enum:
+ - 80
+ - 8080
+ default: 80
+ - url: https://localhost:8080/{version}
+ description: The local server
+ variables:
+ version:
+ enum:
+ - 'v1'
+ - 'v2'
+ default: 'v2'
+ - url: https://127.0.0.1/no_varaible
+ description: The local server without variables
+components:
+ requestBodies:
+ UserArray:
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/User'
+ description: List of user object
+ required: true
+ Client:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Client'
+ description: client model
+ required: true
+ Pet:
+ 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
+ securitySchemes:
+ petstore_auth:
+ type: oauth2
+ flows:
+ implicit:
+ authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog'
+ scopes:
+ 'write:pets': modify pets in your account
+ 'read:pets': read your pets
+ api_key:
+ type: apiKey
+ name: api_key
+ in: header
+ api_key_query:
+ type: apiKey
+ name: api_key_query
+ in: query
+ http_basic_test:
+ type: http
+ scheme: basic
+ bearer_test:
+ type: http
+ scheme: bearer
+ bearerFormat: JWT
+ http_signature_test:
+ # Test the 'HTTP signature' security scheme.
+ # Each HTTP request is cryptographically signed as specified
+ # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/
+ type: http
+ scheme: signature
+ schemas:
+ Foo:
+ type: object
+ properties:
+ bar:
+ $ref: '#/components/schemas/Bar'
+ Bar:
+ type: string
+ default: bar
+ Order:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ petId:
+ type: integer
+ format: int64
+ quantity:
+ type: integer
+ format: int32
+ shipDate:
+ type: string
+ format: date-time
+ status:
+ type: string
+ description: Order Status
+ enum:
+ - placed
+ - approved
+ - delivered
+ complete:
+ type: boolean
+ default: false
+ xml:
+ name: Order
+ Category:
+ type: object
+ required:
+ - name
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ default: default-name
+ xml:
+ name: Category
+ User:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ x-is-unique: true
+ username:
+ type: string
+ firstName:
+ type: string
+ lastName:
+ type: string
+ email:
+ type: string
+ password:
+ type: string
+ phone:
+ type: string
+ userStatus:
+ type: integer
+ format: int32
+ description: User Status
+ xml:
+ name: User
+ Tag:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ xml:
+ name: Tag
+ Pet:
+ type: object
+ required:
+ - name
+ - photoUrls
+ properties:
+ id:
+ type: integer
+ format: int64
+ x-is-unique: true
+ category:
+ $ref: '#/components/schemas/Category'
+ name:
+ type: string
+ example: doggie
+ photoUrls:
+ type: array
+ xml:
+ name: photoUrl
+ wrapped: true
+ items:
+ type: string
+ uniqueItems: true
+ tags:
+ type: array
+ xml:
+ name: tag
+ wrapped: true
+ items:
+ $ref: '#/components/schemas/Tag'
+ status:
+ type: string
+ description: pet status in the store
+ enum:
+ - available
+ - pending
+ - sold
+ xml:
+ name: Pet
+ special_name:
+ type: object
+ properties:
+ property:
+ type: integer
+ format: int64
+ async:
+ $ref: '#/components/schemas/Category'
+ schema:
+ type: string
+ description: pet status in the store
+ enum:
+ - available
+ - pending
+ - sold
+ ApiResponse:
+ type: object
+ properties:
+ code:
+ type: integer
+ format: int32
+ type:
+ type: string
+ message:
+ type: string
+ Return:
+ description: Model for testing reserved words
+ properties:
+ return:
+ type: integer
+ format: int32
+ xml:
+ name: Return
+ Name:
+ description: Model for testing model name same as property name
+ required:
+ - name
+ properties:
+ name:
+ type: integer
+ format: int32
+ snake_case:
+ readOnly: true
+ type: integer
+ format: int32
+ property:
+ type: string
+ 123Number:
+ type: integer
+ readOnly: true
+ xml:
+ name: Name
+ 200_response:
+ description: Model for testing model name starting with number
+ properties:
+ name:
+ type: integer
+ format: int32
+ class:
+ type: string
+ xml:
+ name: Name
+ ClassModel:
+ description: Model for testing model with "_class" property
+ properties:
+ _class:
+ type: string
+ Dog:
+ allOf:
+ - $ref: '#/components/schemas/Animal'
+ - type: object
+ properties:
+ breed:
+ type: string
+ Cat:
+ allOf:
+ - $ref: '#/components/schemas/Animal'
+ - type: object
+ properties:
+ declawed:
+ type: boolean
+ Animal:
+ type: object
+ discriminator:
+ propertyName: className
+ required:
+ - className
+ properties:
+ className:
+ type: string
+ color:
+ type: string
+ default: red
+ AnimalFarm:
+ type: array
+ items:
+ $ref: '#/components/schemas/Animal'
+ format_test:
+ type: object
+ required:
+ - number
+ - byte
+ - date
+ - password
+ properties:
+ integer:
+ type: integer
+ maximum: 100
+ minimum: 10
+ int32:
+ type: integer
+ format: int32
+ maximum: 200
+ minimum: 20
+ int64:
+ type: integer
+ format: int64
+ number:
+ maximum: 543.2
+ minimum: 32.1
+ type: number
+ float:
+ type: number
+ format: float
+ maximum: 987.6
+ minimum: 54.3
+ double:
+ type: number
+ format: double
+ maximum: 123.4
+ minimum: 67.8
+ decimal:
+ type: string
+ format: number
+ string:
+ type: string
+ pattern: '/[a-z]/i'
+ byte:
+ type: string
+ format: byte
+ binary:
+ type: string
+ format: binary
+ date:
+ type: string
+ format: date
+ dateTime:
+ type: string
+ format: date-time
+ uuid:
+ type: string
+ format: uuid
+ example: 72f98069-206d-4f12-9f12-3d1e525a8e84
+ password:
+ type: string
+ format: password
+ maxLength: 64
+ minLength: 10
+ pattern_with_digits:
+ description: A string that is a 10 digit number. Can have leading zeros.
+ type: string
+ pattern: '^\d{10}$'
+ pattern_with_digits_and_delimiter:
+ description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
+ type: string
+ pattern: '/^image_\d{1,3}$/i'
+ EnumClass:
+ type: string
+ default: '-efg'
+ enum:
+ - _abc
+ - '-efg'
+ - (xyz)
+ Enum_Test:
+ type: object
+ required:
+ - enum_string_required
+ properties:
+ enum_string:
+ type: string
+ enum:
+ - UPPER
+ - lower
+ - ''
+ enum_string_required:
+ type: string
+ enum:
+ - UPPER
+ - lower
+ - ''
+ enum_integer:
+ type: integer
+ format: int32
+ enum:
+ - 1
+ - -1
+ enum_number:
+ type: number
+ format: double
+ enum:
+ - 1.1
+ - -1.2
+ outerEnum:
+ $ref: '#/components/schemas/OuterEnum'
+ outerEnumInteger:
+ $ref: '#/components/schemas/OuterEnumInteger'
+ outerEnumDefaultValue:
+ $ref: '#/components/schemas/OuterEnumDefaultValue'
+ outerEnumIntegerDefaultValue:
+ $ref: '#/components/schemas/OuterEnumIntegerDefaultValue'
+ AdditionalPropertiesClass:
+ type: object
+ properties:
+ map_property:
+ type: object
+ additionalProperties:
+ type: string
+ map_of_map_property:
+ type: object
+ additionalProperties:
+ type: object
+ additionalProperties:
+ type: string
+ MixedPropertiesAndAdditionalPropertiesClass:
+ type: object
+ properties:
+ uuid:
+ type: string
+ format: uuid
+ dateTime:
+ type: string
+ format: date-time
+ map:
+ type: object
+ additionalProperties:
+ $ref: '#/components/schemas/Animal'
+ List:
+ type: object
+ properties:
+ 123-list:
+ type: string
+ Client:
+ type: object
+ properties:
+ client:
+ type: string
+ ReadOnlyFirst:
+ type: object
+ properties:
+ bar:
+ type: string
+ readOnly: true
+ baz:
+ type: string
+ hasOnlyReadOnly:
+ type: object
+ properties:
+ bar:
+ type: string
+ readOnly: true
+ foo:
+ type: string
+ readOnly: true
+ Capitalization:
+ type: object
+ 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
+ MapTest:
+ type: object
+ properties:
+ map_map_of_string:
+ type: object
+ additionalProperties:
+ type: object
+ additionalProperties:
+ type: string
+ map_of_enum_string:
+ type: object
+ additionalProperties:
+ type: string
+ enum:
+ - UPPER
+ - lower
+ direct_map:
+ type: object
+ additionalProperties:
+ type: boolean
+ indirect_map:
+ $ref: '#/components/schemas/StringBooleanMap'
+ ArrayTest:
+ type: object
+ properties:
+ array_of_string:
+ type: array
+ items:
+ type: string
+ minItems: 0
+ maxItems: 3
+ array_array_of_integer:
+ type: array
+ items:
+ type: array
+ items:
+ type: integer
+ format: int64
+ array_array_of_model:
+ type: array
+ items:
+ type: array
+ items:
+ $ref: '#/components/schemas/ReadOnlyFirst'
+ NumberOnly:
+ type: object
+ properties:
+ JustNumber:
+ type: number
+ ArrayOfNumberOnly:
+ type: object
+ properties:
+ ArrayNumber:
+ type: array
+ items:
+ type: number
+ ArrayOfArrayOfNumberOnly:
+ type: object
+ properties:
+ ArrayArrayNumber:
+ type: array
+ items:
+ type: array
+ items:
+ type: number
+ EnumArrays:
+ type: object
+ properties:
+ just_symbol:
+ type: string
+ enum:
+ - '>='
+ - $
+ array_enum:
+ type: array
+ items:
+ type: string
+ enum:
+ - fish
+ - crab
+ OuterEnum:
+ nullable: true
+ type: string
+ enum:
+ - placed
+ - approved
+ - delivered
+ OuterEnumInteger:
+ type: integer
+ enum:
+ - 0
+ - 1
+ - 2
+ example: 2
+ OuterEnumDefaultValue:
+ type: string
+ enum:
+ - placed
+ - approved
+ - delivered
+ default: placed
+ OuterEnumIntegerDefaultValue:
+ type: integer
+ enum:
+ - 0
+ - 1
+ - 2
+ default: 0
+ OuterComposite:
+ type: object
+ properties:
+ my_number:
+ $ref: '#/components/schemas/OuterNumber'
+ my_string:
+ $ref: '#/components/schemas/OuterString'
+ my_boolean:
+ $ref: '#/components/schemas/OuterBoolean'
+ OuterNumber:
+ type: number
+ OuterString:
+ type: string
+ OuterBoolean:
+ type: boolean
+ x-codegen-body-parameter-name: boolean_post_body
+ StringBooleanMap:
+ additionalProperties:
+ type: boolean
+ FileSchemaTestClass:
+ type: object
+ properties:
+ file:
+ $ref: '#/components/schemas/File'
+ files:
+ type: array
+ items:
+ $ref: '#/components/schemas/File'
+ File:
+ type: object
+ description: Must be named `File` for test.
+ properties:
+ sourceURI:
+ description: Test capitalization
+ type: string
+ _special_model.name_:
+ properties:
+ '$special[property.name]':
+ type: integer
+ format: int64
+ xml:
+ name: '$special[model.name]'
+ HealthCheckResult:
+ type: object
+ properties:
+ NullableMessage:
+ nullable: true
+ type: string
+ description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
+ NullableClass:
+ type: object
+ required: [required_integer_prop]
+ properties:
+ required_integer_prop:
+ type: integer
+ nullable: true
+ integer_prop:
+ type: integer
+ nullable: true
+ number_prop:
+ type: number
+ nullable: true
+ boolean_prop:
+ type: boolean
+ nullable: true
+ string_prop:
+ type: string
+ nullable: true
+ date_prop:
+ type: string
+ format: date
+ nullable: true
+ datetime_prop:
+ type: string
+ format: date-time
+ nullable: true
+ array_nullable_prop:
+ type: array
+ nullable: true
+ items:
+ type: object
+ array_and_items_nullable_prop:
+ type: array
+ nullable: true
+ items:
+ type: object
+ nullable: true
+ array_items_nullable:
+ type: array
+ items:
+ type: object
+ nullable: true
+ object_nullable_prop:
+ type: object
+ nullable: true
+ additionalProperties:
+ type: object
+ object_and_items_nullable_prop:
+ type: object
+ nullable: true
+ additionalProperties:
+ type: object
+ nullable: true
+ object_items_nullable:
+ type: object
+ additionalProperties:
+ type: object
+ nullable: true
+ additionalProperties:
+ type: object
+ nullable: true
+ OuterObjectWithEnumProperty:
+ type: object
+ example:
+ value: 2
+ required:
+ - value
+ properties:
+ str_value:
+ $ref: '#/components/schemas/OuterEnum'
+ value:
+ $ref: '#/components/schemas/OuterEnumInteger'
+ DeprecatedObject:
+ type: object
+ deprecated: true
+ properties:
+ name:
+ type: string
+ ObjectWithDeprecatedFields:
+ type: object
+ properties:
+ uuid:
+ type: string
+ id:
+ type: number
+ deprecated: true
+ deprecatedRef:
+ $ref: '#/components/schemas/DeprecatedObject'
+ bars:
+ type: array
+ deprecated: true
+ items:
+ $ref: '#/components/schemas/Bar'
+ AllOfWithSingleRef:
+ type: object
+ properties:
+ username:
+ type: string
+ SingleRefType:
+ allOf:
+ - $ref: '#/components/schemas/SingleRefType'
+ SingleRefType:
+ type: string
+ title: SingleRefType
+ enum:
+ - admin
+ - user
+ Pig:
+ oneOf:
+ - $ref: '#/components/schemas/BasquePig'
+ - $ref: '#/components/schemas/DanishPig'
+ discriminator:
+ propertyName: className
+ BasquePig:
+ type: object
+ properties:
+ className:
+ type: string
+ color:
+ type: string
+ required:
+ - className
+ - color
+ DanishPig:
+ type: object
+ properties:
+ className:
+ type: string
+ size:
+ type: integer
+ required:
+ - className
+ - size
+ AnyOfPig:
+ anyOf:
+ - $ref: '#/components/schemas/BasquePig'
+ - $ref: '#/components/schemas/DanishPig'
+ WithNestedOneOf:
+ type: object
+ properties:
+ size:
+ type: integer
+ nested_pig:
+ $ref: '#/components/schemas/Pig'
+ Self-Reference-Model:
+ type: object
+ properties:
+ size:
+ type: integer
+ nested:
+ $ref: '#/components/schemas/Dummy-Model'
+ Dummy-Model:
+ type: object
+ properties:
+ category:
+ type: string
+ self_ref:
+ $ref: '#/components/schemas/Self-Reference-Model'
diff --git a/pom.xml b/pom.xml
index 1f4ec31cddd..6864f36a535 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1224,6 +1224,8 @@
+ samples/openapi3/client/petstore/python-nextgen
+ samples/openapi3/client/petstore/python-nextgen-aiohttp
samples/client/petstore/python-prior
samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent
diff --git a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesClass.md
index 7e5025e58ce..3b789c81367 100644
--- a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesClass.md
+++ b/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesClass.md
@@ -4,14 +4,14 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**map_string** | **dict(str, str)** | | [optional]
-**map_number** | **dict(str, float)** | | [optional]
-**map_integer** | **dict(str, int)** | | [optional]
-**map_boolean** | **dict(str, bool)** | | [optional]
-**map_array_integer** | **dict(str, list[int])** | | [optional]
-**map_array_anytype** | **dict(str, list[object])** | | [optional]
-**map_map_string** | **dict(str, dict(str, str))** | | [optional]
-**map_map_anytype** | **dict(str, dict(str, object))** | | [optional]
+**map_string** | **dict[str, str]** | | [optional]
+**map_number** | **dict[str, float]** | | [optional]
+**map_integer** | **dict[str, int]** | | [optional]
+**map_boolean** | **dict[str, bool]** | | [optional]
+**map_array_integer** | **dict[str, list[int]]** | | [optional]
+**map_array_anytype** | **dict[str, list[object]]** | | [optional]
+**map_map_string** | **dict[str, dict[str, str]]** | | [optional]
+**map_map_anytype** | **dict[str, dict[str, object]]** | | [optional]
**anytype_1** | **object** | | [optional]
**anytype_2** | **object** | | [optional]
**anytype_3** | **object** | | [optional]
diff --git a/samples/client/petstore/python-asyncio/docs/FakeApi.md b/samples/client/petstore/python-asyncio/docs/FakeApi.md
index 93ddfecf969..f91b85f1636 100644
--- a/samples/client/petstore/python-asyncio/docs/FakeApi.md
+++ b/samples/client/petstore/python-asyncio/docs/FakeApi.md
@@ -777,7 +777,7 @@ configuration = petstore_api.Configuration(
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
- param = {'key': 'param_example'} # dict(str, str) | request body
+ param = {'key': 'param_example'} # dict[str, str] | request body
try:
# test inline additionalProperties
@@ -790,7 +790,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **param** | [**dict(str, str)**](str.md)| request body |
+ **param** | [**dict[str, str]**](str.md)| request body |
### Return type
diff --git a/samples/client/petstore/python-asyncio/docs/MapTest.md b/samples/client/petstore/python-asyncio/docs/MapTest.md
index aea74bc8689..8f136137b52 100644
--- a/samples/client/petstore/python-asyncio/docs/MapTest.md
+++ b/samples/client/petstore/python-asyncio/docs/MapTest.md
@@ -4,10 +4,10 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**map_map_of_string** | **dict(str, dict(str, str))** | | [optional]
-**map_of_enum_string** | **dict(str, str)** | | [optional]
-**direct_map** | **dict(str, bool)** | | [optional]
-**indirect_map** | **dict(str, bool)** | | [optional]
+**map_map_of_string** | **dict[str, dict[str, str]]** | | [optional]
+**map_of_enum_string** | **dict[str, str]** | | [optional]
+**direct_map** | **dict[str, bool]** | | [optional]
+**indirect_map** | **dict[str, bool]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-asyncio/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python-asyncio/docs/MixedPropertiesAndAdditionalPropertiesClass.md
index 53e84e839bb..46fb6992509 100644
--- a/samples/client/petstore/python-asyncio/docs/MixedPropertiesAndAdditionalPropertiesClass.md
+++ b/samples/client/petstore/python-asyncio/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **str** | | [optional]
**date_time** | **datetime** | | [optional]
-**map** | [**dict(str, Animal)**](Animal.md) | | [optional]
+**map** | [**dict[str, Animal]**](Animal.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-asyncio/docs/StoreApi.md b/samples/client/petstore/python-asyncio/docs/StoreApi.md
index 169d7074163..832ed33acca 100644
--- a/samples/client/petstore/python-asyncio/docs/StoreApi.md
+++ b/samples/client/petstore/python-asyncio/docs/StoreApi.md
@@ -73,7 +73,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_inventory**
-> dict(str, int) get_inventory()
+> dict[str, int] get_inventory()
Returns pet inventories by status
@@ -123,7 +123,7 @@ This endpoint does not need any parameter.
### Return type
-**dict(str, int)**
+**dict[str, int]**
### Authorization
diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py
index d76ff0a0676..7eae03dd24e 100644
--- a/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py
+++ b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py
@@ -1779,7 +1779,7 @@ class FakeApi(object):
>>> result = thread.get()
:param param: request body (required)
- :type param: dict(str, str)
+ :type param: dict[str, str]
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -1808,7 +1808,7 @@ class FakeApi(object):
>>> result = thread.get()
:param param: request body (required)
- :type param: dict(str, str)
+ :type param: dict[str, str]
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _return_http_data_only: response data without head status code
diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py
index cbc91a0fc92..17b8b851cfc 100644
--- a/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py
+++ b/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py
@@ -190,7 +190,7 @@ class StoreApi(object):
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
- :rtype: dict(str, int)
+ :rtype: dict[str, int]
"""
kwargs['_return_http_data_only'] = True
return self.get_inventory_with_http_info(**kwargs) # noqa: E501
@@ -226,7 +226,7 @@ class StoreApi(object):
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
- :rtype: tuple(dict(str, int), status_code(int), headers(HTTPHeaderDict))
+ :rtype: tuple(dict[str, int], status_code(int), headers(HTTPHeaderDict))
"""
local_var_params = locals()
@@ -274,7 +274,7 @@ class StoreApi(object):
auth_settings = ['api_key'] # noqa: E501
response_types_map = {
- 200: "dict(str, int)",
+ 200: "dict[str, int]",
}
return self.api_client.call_api(
diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py
index 7b655dd2771..2b87dbade1d 100644
--- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py
+++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py
@@ -302,8 +302,8 @@ class ApiClient(object):
return [self.__deserialize(sub_data, sub_kls)
for sub_data in data]
- if klass.startswith('dict('):
- sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
+ if klass.startswith('dict['):
+ sub_kls = re.match(r'dict\[([^,]*), (.*)\]', klass).group(2)
return {k: self.__deserialize(v, sub_kls)
for k, v in six.iteritems(data)}
diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py
index 52c475c4460..b561f467d21 100644
--- a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py
+++ b/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py
@@ -36,14 +36,14 @@ class AdditionalPropertiesClass(object):
and the value is json key in definition.
"""
openapi_types = {
- 'map_string': 'dict(str, str)',
- 'map_number': 'dict(str, float)',
- 'map_integer': 'dict(str, int)',
- 'map_boolean': 'dict(str, bool)',
- 'map_array_integer': 'dict(str, list[int])',
- 'map_array_anytype': 'dict(str, list[object])',
- 'map_map_string': 'dict(str, dict(str, str))',
- 'map_map_anytype': 'dict(str, dict(str, object))',
+ 'map_string': 'dict[str, str]',
+ 'map_number': 'dict[str, float]',
+ 'map_integer': 'dict[str, int]',
+ 'map_boolean': 'dict[str, bool]',
+ 'map_array_integer': 'dict[str, list[int]]',
+ 'map_array_anytype': 'dict[str, list[object]]',
+ 'map_map_string': 'dict[str, dict[str, str]]',
+ 'map_map_anytype': 'dict[str, dict[str, object]]',
'anytype_1': 'object',
'anytype_2': 'object',
'anytype_3': 'object'
@@ -111,7 +111,7 @@ class AdditionalPropertiesClass(object):
:return: The map_string of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, str)
+ :rtype: dict[str, str]
"""
return self._map_string
@@ -121,7 +121,7 @@ class AdditionalPropertiesClass(object):
:param map_string: The map_string of this AdditionalPropertiesClass. # noqa: E501
- :type map_string: dict(str, str)
+ :type map_string: dict[str, str]
"""
self._map_string = map_string
@@ -132,7 +132,7 @@ class AdditionalPropertiesClass(object):
:return: The map_number of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, float)
+ :rtype: dict[str, float]
"""
return self._map_number
@@ -142,7 +142,7 @@ class AdditionalPropertiesClass(object):
:param map_number: The map_number of this AdditionalPropertiesClass. # noqa: E501
- :type map_number: dict(str, float)
+ :type map_number: dict[str, float]
"""
self._map_number = map_number
@@ -153,7 +153,7 @@ class AdditionalPropertiesClass(object):
:return: The map_integer of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, int)
+ :rtype: dict[str, int]
"""
return self._map_integer
@@ -163,7 +163,7 @@ class AdditionalPropertiesClass(object):
:param map_integer: The map_integer of this AdditionalPropertiesClass. # noqa: E501
- :type map_integer: dict(str, int)
+ :type map_integer: dict[str, int]
"""
self._map_integer = map_integer
@@ -174,7 +174,7 @@ class AdditionalPropertiesClass(object):
:return: The map_boolean of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, bool)
+ :rtype: dict[str, bool]
"""
return self._map_boolean
@@ -184,7 +184,7 @@ class AdditionalPropertiesClass(object):
:param map_boolean: The map_boolean of this AdditionalPropertiesClass. # noqa: E501
- :type map_boolean: dict(str, bool)
+ :type map_boolean: dict[str, bool]
"""
self._map_boolean = map_boolean
@@ -195,7 +195,7 @@ class AdditionalPropertiesClass(object):
:return: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, list[int])
+ :rtype: dict[str, list[int]]
"""
return self._map_array_integer
@@ -205,7 +205,7 @@ class AdditionalPropertiesClass(object):
:param map_array_integer: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501
- :type map_array_integer: dict(str, list[int])
+ :type map_array_integer: dict[str, list[int]]
"""
self._map_array_integer = map_array_integer
@@ -216,7 +216,7 @@ class AdditionalPropertiesClass(object):
:return: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, list[object])
+ :rtype: dict[str, list[object]]
"""
return self._map_array_anytype
@@ -226,7 +226,7 @@ class AdditionalPropertiesClass(object):
:param map_array_anytype: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501
- :type map_array_anytype: dict(str, list[object])
+ :type map_array_anytype: dict[str, list[object]]
"""
self._map_array_anytype = map_array_anytype
@@ -237,7 +237,7 @@ class AdditionalPropertiesClass(object):
:return: The map_map_string of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, dict(str, str))
+ :rtype: dict[str, dict[str, str]]
"""
return self._map_map_string
@@ -247,7 +247,7 @@ class AdditionalPropertiesClass(object):
:param map_map_string: The map_map_string of this AdditionalPropertiesClass. # noqa: E501
- :type map_map_string: dict(str, dict(str, str))
+ :type map_map_string: dict[str, dict[str, str]]
"""
self._map_map_string = map_map_string
@@ -258,7 +258,7 @@ class AdditionalPropertiesClass(object):
:return: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, dict(str, object))
+ :rtype: dict[str, dict[str, object]]
"""
return self._map_map_anytype
@@ -268,7 +268,7 @@ class AdditionalPropertiesClass(object):
:param map_map_anytype: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501
- :type map_map_anytype: dict(str, dict(str, object))
+ :type map_map_anytype: dict[str, dict[str, object]]
"""
self._map_map_anytype = map_map_anytype
diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py
index 21bd2ccda98..606253a90d9 100644
--- a/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py
+++ b/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py
@@ -36,10 +36,10 @@ class MapTest(object):
and the value is json key in definition.
"""
openapi_types = {
- 'map_map_of_string': 'dict(str, dict(str, str))',
- 'map_of_enum_string': 'dict(str, str)',
- 'direct_map': 'dict(str, bool)',
- 'indirect_map': 'dict(str, bool)'
+ 'map_map_of_string': 'dict[str, dict[str, str]]',
+ 'map_of_enum_string': 'dict[str, str]',
+ 'direct_map': 'dict[str, bool]',
+ 'indirect_map': 'dict[str, bool]'
}
attribute_map = {
@@ -76,7 +76,7 @@ class MapTest(object):
:return: The map_map_of_string of this MapTest. # noqa: E501
- :rtype: dict(str, dict(str, str))
+ :rtype: dict[str, dict[str, str]]
"""
return self._map_map_of_string
@@ -86,7 +86,7 @@ class MapTest(object):
:param map_map_of_string: The map_map_of_string of this MapTest. # noqa: E501
- :type map_map_of_string: dict(str, dict(str, str))
+ :type map_map_of_string: dict[str, dict[str, str]]
"""
self._map_map_of_string = map_map_of_string
@@ -97,7 +97,7 @@ class MapTest(object):
:return: The map_of_enum_string of this MapTest. # noqa: E501
- :rtype: dict(str, str)
+ :rtype: dict[str, str]
"""
return self._map_of_enum_string
@@ -107,7 +107,7 @@ class MapTest(object):
:param map_of_enum_string: The map_of_enum_string of this MapTest. # noqa: E501
- :type map_of_enum_string: dict(str, str)
+ :type map_of_enum_string: dict[str, str]
"""
allowed_values = ["UPPER", "lower"] # noqa: E501
if (self.local_vars_configuration.client_side_validation and
@@ -126,7 +126,7 @@ class MapTest(object):
:return: The direct_map of this MapTest. # noqa: E501
- :rtype: dict(str, bool)
+ :rtype: dict[str, bool]
"""
return self._direct_map
@@ -136,7 +136,7 @@ class MapTest(object):
:param direct_map: The direct_map of this MapTest. # noqa: E501
- :type direct_map: dict(str, bool)
+ :type direct_map: dict[str, bool]
"""
self._direct_map = direct_map
@@ -147,7 +147,7 @@ class MapTest(object):
:return: The indirect_map of this MapTest. # noqa: E501
- :rtype: dict(str, bool)
+ :rtype: dict[str, bool]
"""
return self._indirect_map
@@ -157,7 +157,7 @@ class MapTest(object):
:param indirect_map: The indirect_map of this MapTest. # noqa: E501
- :type indirect_map: dict(str, bool)
+ :type indirect_map: dict[str, bool]
"""
self._indirect_map = indirect_map
diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py
index 9e727b07d5c..96aedc145c4 100644
--- a/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py
+++ b/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py
@@ -38,7 +38,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
openapi_types = {
'uuid': 'str',
'date_time': 'datetime',
- 'map': 'dict(str, Animal)'
+ 'map': 'dict[str, Animal]'
}
attribute_map = {
@@ -113,7 +113,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
:return: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, Animal)
+ :rtype: dict[str, Animal]
"""
return self._map
@@ -123,7 +123,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
:param map: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
- :type map: dict(str, Animal)
+ :type map: dict[str, Animal]
"""
self._map = map
diff --git a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md
index 7e5025e58ce..3b789c81367 100644
--- a/samples/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md
+++ b/samples/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md
@@ -4,14 +4,14 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**map_string** | **dict(str, str)** | | [optional]
-**map_number** | **dict(str, float)** | | [optional]
-**map_integer** | **dict(str, int)** | | [optional]
-**map_boolean** | **dict(str, bool)** | | [optional]
-**map_array_integer** | **dict(str, list[int])** | | [optional]
-**map_array_anytype** | **dict(str, list[object])** | | [optional]
-**map_map_string** | **dict(str, dict(str, str))** | | [optional]
-**map_map_anytype** | **dict(str, dict(str, object))** | | [optional]
+**map_string** | **dict[str, str]** | | [optional]
+**map_number** | **dict[str, float]** | | [optional]
+**map_integer** | **dict[str, int]** | | [optional]
+**map_boolean** | **dict[str, bool]** | | [optional]
+**map_array_integer** | **dict[str, list[int]]** | | [optional]
+**map_array_anytype** | **dict[str, list[object]]** | | [optional]
+**map_map_string** | **dict[str, dict[str, str]]** | | [optional]
+**map_map_anytype** | **dict[str, dict[str, object]]** | | [optional]
**anytype_1** | **object** | | [optional]
**anytype_2** | **object** | | [optional]
**anytype_3** | **object** | | [optional]
diff --git a/samples/client/petstore/python-legacy/docs/FakeApi.md b/samples/client/petstore/python-legacy/docs/FakeApi.md
index 93ddfecf969..f91b85f1636 100644
--- a/samples/client/petstore/python-legacy/docs/FakeApi.md
+++ b/samples/client/petstore/python-legacy/docs/FakeApi.md
@@ -777,7 +777,7 @@ configuration = petstore_api.Configuration(
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
- param = {'key': 'param_example'} # dict(str, str) | request body
+ param = {'key': 'param_example'} # dict[str, str] | request body
try:
# test inline additionalProperties
@@ -790,7 +790,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **param** | [**dict(str, str)**](str.md)| request body |
+ **param** | [**dict[str, str]**](str.md)| request body |
### Return type
diff --git a/samples/client/petstore/python-legacy/docs/MapTest.md b/samples/client/petstore/python-legacy/docs/MapTest.md
index aea74bc8689..8f136137b52 100644
--- a/samples/client/petstore/python-legacy/docs/MapTest.md
+++ b/samples/client/petstore/python-legacy/docs/MapTest.md
@@ -4,10 +4,10 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**map_map_of_string** | **dict(str, dict(str, str))** | | [optional]
-**map_of_enum_string** | **dict(str, str)** | | [optional]
-**direct_map** | **dict(str, bool)** | | [optional]
-**indirect_map** | **dict(str, bool)** | | [optional]
+**map_map_of_string** | **dict[str, dict[str, str]]** | | [optional]
+**map_of_enum_string** | **dict[str, str]** | | [optional]
+**direct_map** | **dict[str, bool]** | | [optional]
+**indirect_map** | **dict[str, bool]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md
index 53e84e839bb..46fb6992509 100644
--- a/samples/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md
+++ b/samples/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **str** | | [optional]
**date_time** | **datetime** | | [optional]
-**map** | [**dict(str, Animal)**](Animal.md) | | [optional]
+**map** | [**dict[str, Animal]**](Animal.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-legacy/docs/StoreApi.md b/samples/client/petstore/python-legacy/docs/StoreApi.md
index 169d7074163..832ed33acca 100644
--- a/samples/client/petstore/python-legacy/docs/StoreApi.md
+++ b/samples/client/petstore/python-legacy/docs/StoreApi.md
@@ -73,7 +73,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_inventory**
-> dict(str, int) get_inventory()
+> dict[str, int] get_inventory()
Returns pet inventories by status
@@ -123,7 +123,7 @@ This endpoint does not need any parameter.
### Return type
-**dict(str, int)**
+**dict[str, int]**
### Authorization
diff --git a/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py
index d76ff0a0676..7eae03dd24e 100644
--- a/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py
+++ b/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py
@@ -1779,7 +1779,7 @@ class FakeApi(object):
>>> result = thread.get()
:param param: request body (required)
- :type param: dict(str, str)
+ :type param: dict[str, str]
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -1808,7 +1808,7 @@ class FakeApi(object):
>>> result = thread.get()
:param param: request body (required)
- :type param: dict(str, str)
+ :type param: dict[str, str]
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _return_http_data_only: response data without head status code
diff --git a/samples/client/petstore/python-legacy/petstore_api/api/store_api.py b/samples/client/petstore/python-legacy/petstore_api/api/store_api.py
index cbc91a0fc92..17b8b851cfc 100644
--- a/samples/client/petstore/python-legacy/petstore_api/api/store_api.py
+++ b/samples/client/petstore/python-legacy/petstore_api/api/store_api.py
@@ -190,7 +190,7 @@ class StoreApi(object):
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
- :rtype: dict(str, int)
+ :rtype: dict[str, int]
"""
kwargs['_return_http_data_only'] = True
return self.get_inventory_with_http_info(**kwargs) # noqa: E501
@@ -226,7 +226,7 @@ class StoreApi(object):
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
- :rtype: tuple(dict(str, int), status_code(int), headers(HTTPHeaderDict))
+ :rtype: tuple(dict[str, int], status_code(int), headers(HTTPHeaderDict))
"""
local_var_params = locals()
@@ -274,7 +274,7 @@ class StoreApi(object):
auth_settings = ['api_key'] # noqa: E501
response_types_map = {
- 200: "dict(str, int)",
+ 200: "dict[str, int]",
}
return self.api_client.call_api(
diff --git a/samples/client/petstore/python-legacy/petstore_api/api_client.py b/samples/client/petstore/python-legacy/petstore_api/api_client.py
index 10d903cb0df..294f6f87c73 100644
--- a/samples/client/petstore/python-legacy/petstore_api/api_client.py
+++ b/samples/client/petstore/python-legacy/petstore_api/api_client.py
@@ -301,8 +301,8 @@ class ApiClient(object):
return [self.__deserialize(sub_data, sub_kls)
for sub_data in data]
- if klass.startswith('dict('):
- sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
+ if klass.startswith('dict['):
+ sub_kls = re.match(r'dict\[([^,]*), (.*)\]', klass).group(2)
return {k: self.__deserialize(v, sub_kls)
for k, v in six.iteritems(data)}
diff --git a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py
index 52c475c4460..b561f467d21 100644
--- a/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py
+++ b/samples/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py
@@ -36,14 +36,14 @@ class AdditionalPropertiesClass(object):
and the value is json key in definition.
"""
openapi_types = {
- 'map_string': 'dict(str, str)',
- 'map_number': 'dict(str, float)',
- 'map_integer': 'dict(str, int)',
- 'map_boolean': 'dict(str, bool)',
- 'map_array_integer': 'dict(str, list[int])',
- 'map_array_anytype': 'dict(str, list[object])',
- 'map_map_string': 'dict(str, dict(str, str))',
- 'map_map_anytype': 'dict(str, dict(str, object))',
+ 'map_string': 'dict[str, str]',
+ 'map_number': 'dict[str, float]',
+ 'map_integer': 'dict[str, int]',
+ 'map_boolean': 'dict[str, bool]',
+ 'map_array_integer': 'dict[str, list[int]]',
+ 'map_array_anytype': 'dict[str, list[object]]',
+ 'map_map_string': 'dict[str, dict[str, str]]',
+ 'map_map_anytype': 'dict[str, dict[str, object]]',
'anytype_1': 'object',
'anytype_2': 'object',
'anytype_3': 'object'
@@ -111,7 +111,7 @@ class AdditionalPropertiesClass(object):
:return: The map_string of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, str)
+ :rtype: dict[str, str]
"""
return self._map_string
@@ -121,7 +121,7 @@ class AdditionalPropertiesClass(object):
:param map_string: The map_string of this AdditionalPropertiesClass. # noqa: E501
- :type map_string: dict(str, str)
+ :type map_string: dict[str, str]
"""
self._map_string = map_string
@@ -132,7 +132,7 @@ class AdditionalPropertiesClass(object):
:return: The map_number of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, float)
+ :rtype: dict[str, float]
"""
return self._map_number
@@ -142,7 +142,7 @@ class AdditionalPropertiesClass(object):
:param map_number: The map_number of this AdditionalPropertiesClass. # noqa: E501
- :type map_number: dict(str, float)
+ :type map_number: dict[str, float]
"""
self._map_number = map_number
@@ -153,7 +153,7 @@ class AdditionalPropertiesClass(object):
:return: The map_integer of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, int)
+ :rtype: dict[str, int]
"""
return self._map_integer
@@ -163,7 +163,7 @@ class AdditionalPropertiesClass(object):
:param map_integer: The map_integer of this AdditionalPropertiesClass. # noqa: E501
- :type map_integer: dict(str, int)
+ :type map_integer: dict[str, int]
"""
self._map_integer = map_integer
@@ -174,7 +174,7 @@ class AdditionalPropertiesClass(object):
:return: The map_boolean of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, bool)
+ :rtype: dict[str, bool]
"""
return self._map_boolean
@@ -184,7 +184,7 @@ class AdditionalPropertiesClass(object):
:param map_boolean: The map_boolean of this AdditionalPropertiesClass. # noqa: E501
- :type map_boolean: dict(str, bool)
+ :type map_boolean: dict[str, bool]
"""
self._map_boolean = map_boolean
@@ -195,7 +195,7 @@ class AdditionalPropertiesClass(object):
:return: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, list[int])
+ :rtype: dict[str, list[int]]
"""
return self._map_array_integer
@@ -205,7 +205,7 @@ class AdditionalPropertiesClass(object):
:param map_array_integer: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501
- :type map_array_integer: dict(str, list[int])
+ :type map_array_integer: dict[str, list[int]]
"""
self._map_array_integer = map_array_integer
@@ -216,7 +216,7 @@ class AdditionalPropertiesClass(object):
:return: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, list[object])
+ :rtype: dict[str, list[object]]
"""
return self._map_array_anytype
@@ -226,7 +226,7 @@ class AdditionalPropertiesClass(object):
:param map_array_anytype: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501
- :type map_array_anytype: dict(str, list[object])
+ :type map_array_anytype: dict[str, list[object]]
"""
self._map_array_anytype = map_array_anytype
@@ -237,7 +237,7 @@ class AdditionalPropertiesClass(object):
:return: The map_map_string of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, dict(str, str))
+ :rtype: dict[str, dict[str, str]]
"""
return self._map_map_string
@@ -247,7 +247,7 @@ class AdditionalPropertiesClass(object):
:param map_map_string: The map_map_string of this AdditionalPropertiesClass. # noqa: E501
- :type map_map_string: dict(str, dict(str, str))
+ :type map_map_string: dict[str, dict[str, str]]
"""
self._map_map_string = map_map_string
@@ -258,7 +258,7 @@ class AdditionalPropertiesClass(object):
:return: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, dict(str, object))
+ :rtype: dict[str, dict[str, object]]
"""
return self._map_map_anytype
@@ -268,7 +268,7 @@ class AdditionalPropertiesClass(object):
:param map_map_anytype: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501
- :type map_map_anytype: dict(str, dict(str, object))
+ :type map_map_anytype: dict[str, dict[str, object]]
"""
self._map_map_anytype = map_map_anytype
diff --git a/samples/client/petstore/python-legacy/petstore_api/models/map_test.py b/samples/client/petstore/python-legacy/petstore_api/models/map_test.py
index 21bd2ccda98..606253a90d9 100644
--- a/samples/client/petstore/python-legacy/petstore_api/models/map_test.py
+++ b/samples/client/petstore/python-legacy/petstore_api/models/map_test.py
@@ -36,10 +36,10 @@ class MapTest(object):
and the value is json key in definition.
"""
openapi_types = {
- 'map_map_of_string': 'dict(str, dict(str, str))',
- 'map_of_enum_string': 'dict(str, str)',
- 'direct_map': 'dict(str, bool)',
- 'indirect_map': 'dict(str, bool)'
+ 'map_map_of_string': 'dict[str, dict[str, str]]',
+ 'map_of_enum_string': 'dict[str, str]',
+ 'direct_map': 'dict[str, bool]',
+ 'indirect_map': 'dict[str, bool]'
}
attribute_map = {
@@ -76,7 +76,7 @@ class MapTest(object):
:return: The map_map_of_string of this MapTest. # noqa: E501
- :rtype: dict(str, dict(str, str))
+ :rtype: dict[str, dict[str, str]]
"""
return self._map_map_of_string
@@ -86,7 +86,7 @@ class MapTest(object):
:param map_map_of_string: The map_map_of_string of this MapTest. # noqa: E501
- :type map_map_of_string: dict(str, dict(str, str))
+ :type map_map_of_string: dict[str, dict[str, str]]
"""
self._map_map_of_string = map_map_of_string
@@ -97,7 +97,7 @@ class MapTest(object):
:return: The map_of_enum_string of this MapTest. # noqa: E501
- :rtype: dict(str, str)
+ :rtype: dict[str, str]
"""
return self._map_of_enum_string
@@ -107,7 +107,7 @@ class MapTest(object):
:param map_of_enum_string: The map_of_enum_string of this MapTest. # noqa: E501
- :type map_of_enum_string: dict(str, str)
+ :type map_of_enum_string: dict[str, str]
"""
allowed_values = ["UPPER", "lower"] # noqa: E501
if (self.local_vars_configuration.client_side_validation and
@@ -126,7 +126,7 @@ class MapTest(object):
:return: The direct_map of this MapTest. # noqa: E501
- :rtype: dict(str, bool)
+ :rtype: dict[str, bool]
"""
return self._direct_map
@@ -136,7 +136,7 @@ class MapTest(object):
:param direct_map: The direct_map of this MapTest. # noqa: E501
- :type direct_map: dict(str, bool)
+ :type direct_map: dict[str, bool]
"""
self._direct_map = direct_map
@@ -147,7 +147,7 @@ class MapTest(object):
:return: The indirect_map of this MapTest. # noqa: E501
- :rtype: dict(str, bool)
+ :rtype: dict[str, bool]
"""
return self._indirect_map
@@ -157,7 +157,7 @@ class MapTest(object):
:param indirect_map: The indirect_map of this MapTest. # noqa: E501
- :type indirect_map: dict(str, bool)
+ :type indirect_map: dict[str, bool]
"""
self._indirect_map = indirect_map
diff --git a/samples/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py
index 9e727b07d5c..96aedc145c4 100644
--- a/samples/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py
+++ b/samples/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py
@@ -38,7 +38,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
openapi_types = {
'uuid': 'str',
'date_time': 'datetime',
- 'map': 'dict(str, Animal)'
+ 'map': 'dict[str, Animal]'
}
attribute_map = {
@@ -113,7 +113,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
:return: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, Animal)
+ :rtype: dict[str, Animal]
"""
return self._map
@@ -123,7 +123,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
:param map: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
- :type map: dict(str, Animal)
+ :type map: dict[str, Animal]
"""
self._map = map
diff --git a/samples/client/petstore/python-legacy/tests/test_deserialization.py b/samples/client/petstore/python-legacy/tests/test_deserialization.py
index 6c4e083d1cd..3192b944d92 100644
--- a/samples/client/petstore/python-legacy/tests/test_deserialization.py
+++ b/samples/client/petstore/python-legacy/tests/test_deserialization.py
@@ -40,7 +40,7 @@ class DeserializationTests(unittest.TestCase):
}
response = MockResponse(data=json.dumps(data))
- deserialized = self.deserialize(response, 'dict(str, EnumTest)')
+ deserialized = self.deserialize(response, 'dict[str, EnumTest]')
self.assertTrue(isinstance(deserialized, dict))
self.assertTrue(isinstance(deserialized['enum_test'], petstore_api.EnumTest))
self.assertEqual(deserialized['enum_test'],
@@ -74,7 +74,7 @@ class DeserializationTests(unittest.TestCase):
}
response = MockResponse(data=json.dumps(data))
- deserialized = self.deserialize(response, 'dict(str, Pet)')
+ deserialized = self.deserialize(response, 'dict[str, Pet]')
self.assertTrue(isinstance(deserialized, dict))
self.assertTrue(isinstance(deserialized['pet'], petstore_api.Pet))
@@ -90,7 +90,7 @@ class DeserializationTests(unittest.TestCase):
}
response = MockResponse(data=json.dumps(data))
- deserialized = self.deserialize(response, 'dict(str, Animal)')
+ deserialized = self.deserialize(response, 'dict[str, Animal]')
self.assertTrue(isinstance(deserialized, dict))
self.assertTrue(isinstance(deserialized['dog'], petstore_api.Dog))
@@ -101,7 +101,7 @@ class DeserializationTests(unittest.TestCase):
}
response = MockResponse(data=json.dumps(data))
- deserialized = self.deserialize(response, 'dict(str, int)')
+ deserialized = self.deserialize(response, 'dict[str, int]')
self.assertTrue(isinstance(deserialized, dict))
self.assertTrue(isinstance(deserialized['integer'], int))
@@ -218,7 +218,7 @@ class DeserializationTests(unittest.TestCase):
}
response = MockResponse(data=json.dumps(data))
- deserialized = self.deserialize(response, "dict(str, dict(str, int))")
+ deserialized = self.deserialize(response, "dict[str, dict[str, int]]")
self.assertTrue(isinstance(deserialized, dict))
self.assertTrue(isinstance(deserialized["foo"], dict))
self.assertTrue(isinstance(deserialized["foo"]["bar"], int))
diff --git a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-tornado/docs/AdditionalPropertiesClass.md
index 7e5025e58ce..3b789c81367 100644
--- a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesClass.md
+++ b/samples/client/petstore/python-tornado/docs/AdditionalPropertiesClass.md
@@ -4,14 +4,14 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**map_string** | **dict(str, str)** | | [optional]
-**map_number** | **dict(str, float)** | | [optional]
-**map_integer** | **dict(str, int)** | | [optional]
-**map_boolean** | **dict(str, bool)** | | [optional]
-**map_array_integer** | **dict(str, list[int])** | | [optional]
-**map_array_anytype** | **dict(str, list[object])** | | [optional]
-**map_map_string** | **dict(str, dict(str, str))** | | [optional]
-**map_map_anytype** | **dict(str, dict(str, object))** | | [optional]
+**map_string** | **dict[str, str]** | | [optional]
+**map_number** | **dict[str, float]** | | [optional]
+**map_integer** | **dict[str, int]** | | [optional]
+**map_boolean** | **dict[str, bool]** | | [optional]
+**map_array_integer** | **dict[str, list[int]]** | | [optional]
+**map_array_anytype** | **dict[str, list[object]]** | | [optional]
+**map_map_string** | **dict[str, dict[str, str]]** | | [optional]
+**map_map_anytype** | **dict[str, dict[str, object]]** | | [optional]
**anytype_1** | **object** | | [optional]
**anytype_2** | **object** | | [optional]
**anytype_3** | **object** | | [optional]
diff --git a/samples/client/petstore/python-tornado/docs/FakeApi.md b/samples/client/petstore/python-tornado/docs/FakeApi.md
index 93ddfecf969..f91b85f1636 100644
--- a/samples/client/petstore/python-tornado/docs/FakeApi.md
+++ b/samples/client/petstore/python-tornado/docs/FakeApi.md
@@ -777,7 +777,7 @@ configuration = petstore_api.Configuration(
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
- param = {'key': 'param_example'} # dict(str, str) | request body
+ param = {'key': 'param_example'} # dict[str, str] | request body
try:
# test inline additionalProperties
@@ -790,7 +790,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **param** | [**dict(str, str)**](str.md)| request body |
+ **param** | [**dict[str, str]**](str.md)| request body |
### Return type
diff --git a/samples/client/petstore/python-tornado/docs/MapTest.md b/samples/client/petstore/python-tornado/docs/MapTest.md
index aea74bc8689..8f136137b52 100644
--- a/samples/client/petstore/python-tornado/docs/MapTest.md
+++ b/samples/client/petstore/python-tornado/docs/MapTest.md
@@ -4,10 +4,10 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**map_map_of_string** | **dict(str, dict(str, str))** | | [optional]
-**map_of_enum_string** | **dict(str, str)** | | [optional]
-**direct_map** | **dict(str, bool)** | | [optional]
-**indirect_map** | **dict(str, bool)** | | [optional]
+**map_map_of_string** | **dict[str, dict[str, str]]** | | [optional]
+**map_of_enum_string** | **dict[str, str]** | | [optional]
+**direct_map** | **dict[str, bool]** | | [optional]
+**indirect_map** | **dict[str, bool]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-tornado/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python-tornado/docs/MixedPropertiesAndAdditionalPropertiesClass.md
index 53e84e839bb..46fb6992509 100644
--- a/samples/client/petstore/python-tornado/docs/MixedPropertiesAndAdditionalPropertiesClass.md
+++ b/samples/client/petstore/python-tornado/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **str** | | [optional]
**date_time** | **datetime** | | [optional]
-**map** | [**dict(str, Animal)**](Animal.md) | | [optional]
+**map** | [**dict[str, Animal]**](Animal.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/petstore/python-tornado/docs/StoreApi.md b/samples/client/petstore/python-tornado/docs/StoreApi.md
index 169d7074163..832ed33acca 100644
--- a/samples/client/petstore/python-tornado/docs/StoreApi.md
+++ b/samples/client/petstore/python-tornado/docs/StoreApi.md
@@ -73,7 +73,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_inventory**
-> dict(str, int) get_inventory()
+> dict[str, int] get_inventory()
Returns pet inventories by status
@@ -123,7 +123,7 @@ This endpoint does not need any parameter.
### Return type
-**dict(str, int)**
+**dict[str, int]**
### Authorization
diff --git a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py
index d76ff0a0676..7eae03dd24e 100644
--- a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py
+++ b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py
@@ -1779,7 +1779,7 @@ class FakeApi(object):
>>> result = thread.get()
:param param: request body (required)
- :type param: dict(str, str)
+ :type param: dict[str, str]
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -1808,7 +1808,7 @@ class FakeApi(object):
>>> result = thread.get()
:param param: request body (required)
- :type param: dict(str, str)
+ :type param: dict[str, str]
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _return_http_data_only: response data without head status code
diff --git a/samples/client/petstore/python-tornado/petstore_api/api/store_api.py b/samples/client/petstore/python-tornado/petstore_api/api/store_api.py
index cbc91a0fc92..17b8b851cfc 100644
--- a/samples/client/petstore/python-tornado/petstore_api/api/store_api.py
+++ b/samples/client/petstore/python-tornado/petstore_api/api/store_api.py
@@ -190,7 +190,7 @@ class StoreApi(object):
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
- :rtype: dict(str, int)
+ :rtype: dict[str, int]
"""
kwargs['_return_http_data_only'] = True
return self.get_inventory_with_http_info(**kwargs) # noqa: E501
@@ -226,7 +226,7 @@ class StoreApi(object):
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
- :rtype: tuple(dict(str, int), status_code(int), headers(HTTPHeaderDict))
+ :rtype: tuple(dict[str, int], status_code(int), headers(HTTPHeaderDict))
"""
local_var_params = locals()
@@ -274,7 +274,7 @@ class StoreApi(object):
auth_settings = ['api_key'] # noqa: E501
response_types_map = {
- 200: "dict(str, int)",
+ 200: "dict[str, int]",
}
return self.api_client.call_api(
diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py
index 2b978d96a8f..cd19b46dc88 100644
--- a/samples/client/petstore/python-tornado/petstore_api/api_client.py
+++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py
@@ -303,8 +303,8 @@ class ApiClient(object):
return [self.__deserialize(sub_data, sub_kls)
for sub_data in data]
- if klass.startswith('dict('):
- sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
+ if klass.startswith('dict['):
+ sub_kls = re.match(r'dict\[([^,]*), (.*)\]', klass).group(2)
return {k: self.__deserialize(v, sub_kls)
for k, v in six.iteritems(data)}
diff --git a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py
index 52c475c4460..b561f467d21 100644
--- a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py
+++ b/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py
@@ -36,14 +36,14 @@ class AdditionalPropertiesClass(object):
and the value is json key in definition.
"""
openapi_types = {
- 'map_string': 'dict(str, str)',
- 'map_number': 'dict(str, float)',
- 'map_integer': 'dict(str, int)',
- 'map_boolean': 'dict(str, bool)',
- 'map_array_integer': 'dict(str, list[int])',
- 'map_array_anytype': 'dict(str, list[object])',
- 'map_map_string': 'dict(str, dict(str, str))',
- 'map_map_anytype': 'dict(str, dict(str, object))',
+ 'map_string': 'dict[str, str]',
+ 'map_number': 'dict[str, float]',
+ 'map_integer': 'dict[str, int]',
+ 'map_boolean': 'dict[str, bool]',
+ 'map_array_integer': 'dict[str, list[int]]',
+ 'map_array_anytype': 'dict[str, list[object]]',
+ 'map_map_string': 'dict[str, dict[str, str]]',
+ 'map_map_anytype': 'dict[str, dict[str, object]]',
'anytype_1': 'object',
'anytype_2': 'object',
'anytype_3': 'object'
@@ -111,7 +111,7 @@ class AdditionalPropertiesClass(object):
:return: The map_string of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, str)
+ :rtype: dict[str, str]
"""
return self._map_string
@@ -121,7 +121,7 @@ class AdditionalPropertiesClass(object):
:param map_string: The map_string of this AdditionalPropertiesClass. # noqa: E501
- :type map_string: dict(str, str)
+ :type map_string: dict[str, str]
"""
self._map_string = map_string
@@ -132,7 +132,7 @@ class AdditionalPropertiesClass(object):
:return: The map_number of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, float)
+ :rtype: dict[str, float]
"""
return self._map_number
@@ -142,7 +142,7 @@ class AdditionalPropertiesClass(object):
:param map_number: The map_number of this AdditionalPropertiesClass. # noqa: E501
- :type map_number: dict(str, float)
+ :type map_number: dict[str, float]
"""
self._map_number = map_number
@@ -153,7 +153,7 @@ class AdditionalPropertiesClass(object):
:return: The map_integer of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, int)
+ :rtype: dict[str, int]
"""
return self._map_integer
@@ -163,7 +163,7 @@ class AdditionalPropertiesClass(object):
:param map_integer: The map_integer of this AdditionalPropertiesClass. # noqa: E501
- :type map_integer: dict(str, int)
+ :type map_integer: dict[str, int]
"""
self._map_integer = map_integer
@@ -174,7 +174,7 @@ class AdditionalPropertiesClass(object):
:return: The map_boolean of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, bool)
+ :rtype: dict[str, bool]
"""
return self._map_boolean
@@ -184,7 +184,7 @@ class AdditionalPropertiesClass(object):
:param map_boolean: The map_boolean of this AdditionalPropertiesClass. # noqa: E501
- :type map_boolean: dict(str, bool)
+ :type map_boolean: dict[str, bool]
"""
self._map_boolean = map_boolean
@@ -195,7 +195,7 @@ class AdditionalPropertiesClass(object):
:return: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, list[int])
+ :rtype: dict[str, list[int]]
"""
return self._map_array_integer
@@ -205,7 +205,7 @@ class AdditionalPropertiesClass(object):
:param map_array_integer: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501
- :type map_array_integer: dict(str, list[int])
+ :type map_array_integer: dict[str, list[int]]
"""
self._map_array_integer = map_array_integer
@@ -216,7 +216,7 @@ class AdditionalPropertiesClass(object):
:return: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, list[object])
+ :rtype: dict[str, list[object]]
"""
return self._map_array_anytype
@@ -226,7 +226,7 @@ class AdditionalPropertiesClass(object):
:param map_array_anytype: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501
- :type map_array_anytype: dict(str, list[object])
+ :type map_array_anytype: dict[str, list[object]]
"""
self._map_array_anytype = map_array_anytype
@@ -237,7 +237,7 @@ class AdditionalPropertiesClass(object):
:return: The map_map_string of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, dict(str, str))
+ :rtype: dict[str, dict[str, str]]
"""
return self._map_map_string
@@ -247,7 +247,7 @@ class AdditionalPropertiesClass(object):
:param map_map_string: The map_map_string of this AdditionalPropertiesClass. # noqa: E501
- :type map_map_string: dict(str, dict(str, str))
+ :type map_map_string: dict[str, dict[str, str]]
"""
self._map_map_string = map_map_string
@@ -258,7 +258,7 @@ class AdditionalPropertiesClass(object):
:return: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, dict(str, object))
+ :rtype: dict[str, dict[str, object]]
"""
return self._map_map_anytype
@@ -268,7 +268,7 @@ class AdditionalPropertiesClass(object):
:param map_map_anytype: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501
- :type map_map_anytype: dict(str, dict(str, object))
+ :type map_map_anytype: dict[str, dict[str, object]]
"""
self._map_map_anytype = map_map_anytype
diff --git a/samples/client/petstore/python-tornado/petstore_api/models/map_test.py b/samples/client/petstore/python-tornado/petstore_api/models/map_test.py
index 21bd2ccda98..606253a90d9 100644
--- a/samples/client/petstore/python-tornado/petstore_api/models/map_test.py
+++ b/samples/client/petstore/python-tornado/petstore_api/models/map_test.py
@@ -36,10 +36,10 @@ class MapTest(object):
and the value is json key in definition.
"""
openapi_types = {
- 'map_map_of_string': 'dict(str, dict(str, str))',
- 'map_of_enum_string': 'dict(str, str)',
- 'direct_map': 'dict(str, bool)',
- 'indirect_map': 'dict(str, bool)'
+ 'map_map_of_string': 'dict[str, dict[str, str]]',
+ 'map_of_enum_string': 'dict[str, str]',
+ 'direct_map': 'dict[str, bool]',
+ 'indirect_map': 'dict[str, bool]'
}
attribute_map = {
@@ -76,7 +76,7 @@ class MapTest(object):
:return: The map_map_of_string of this MapTest. # noqa: E501
- :rtype: dict(str, dict(str, str))
+ :rtype: dict[str, dict[str, str]]
"""
return self._map_map_of_string
@@ -86,7 +86,7 @@ class MapTest(object):
:param map_map_of_string: The map_map_of_string of this MapTest. # noqa: E501
- :type map_map_of_string: dict(str, dict(str, str))
+ :type map_map_of_string: dict[str, dict[str, str]]
"""
self._map_map_of_string = map_map_of_string
@@ -97,7 +97,7 @@ class MapTest(object):
:return: The map_of_enum_string of this MapTest. # noqa: E501
- :rtype: dict(str, str)
+ :rtype: dict[str, str]
"""
return self._map_of_enum_string
@@ -107,7 +107,7 @@ class MapTest(object):
:param map_of_enum_string: The map_of_enum_string of this MapTest. # noqa: E501
- :type map_of_enum_string: dict(str, str)
+ :type map_of_enum_string: dict[str, str]
"""
allowed_values = ["UPPER", "lower"] # noqa: E501
if (self.local_vars_configuration.client_side_validation and
@@ -126,7 +126,7 @@ class MapTest(object):
:return: The direct_map of this MapTest. # noqa: E501
- :rtype: dict(str, bool)
+ :rtype: dict[str, bool]
"""
return self._direct_map
@@ -136,7 +136,7 @@ class MapTest(object):
:param direct_map: The direct_map of this MapTest. # noqa: E501
- :type direct_map: dict(str, bool)
+ :type direct_map: dict[str, bool]
"""
self._direct_map = direct_map
@@ -147,7 +147,7 @@ class MapTest(object):
:return: The indirect_map of this MapTest. # noqa: E501
- :rtype: dict(str, bool)
+ :rtype: dict[str, bool]
"""
return self._indirect_map
@@ -157,7 +157,7 @@ class MapTest(object):
:param indirect_map: The indirect_map of this MapTest. # noqa: E501
- :type indirect_map: dict(str, bool)
+ :type indirect_map: dict[str, bool]
"""
self._indirect_map = indirect_map
diff --git a/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py
index 9e727b07d5c..96aedc145c4 100644
--- a/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py
+++ b/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py
@@ -38,7 +38,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
openapi_types = {
'uuid': 'str',
'date_time': 'datetime',
- 'map': 'dict(str, Animal)'
+ 'map': 'dict[str, Animal]'
}
attribute_map = {
@@ -113,7 +113,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
:return: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, Animal)
+ :rtype: dict[str, Animal]
"""
return self._map
@@ -123,7 +123,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
:param map: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
- :type map: dict(str, Animal)
+ :type map: dict[str, Animal]
"""
self._map = map
diff --git a/samples/openapi3/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md
index 44eba731566..d08ea901b62 100755
--- a/samples/openapi3/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/AdditionalPropertiesClass.md
@@ -4,8 +4,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**map_property** | **dict(str, str)** | | [optional]
-**map_of_map_property** | **dict(str, dict(str, str))** | | [optional]
+**map_property** | **dict[str, str]** | | [optional]
+**map_of_map_property** | **dict[str, dict[str, str]]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md b/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md
index 1fed1dfce9b..f8396a5d1f9 100755
--- a/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md
@@ -1037,7 +1037,7 @@ configuration = petstore_api.Configuration(
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
- request_body = {'key': 'request_body_example'} # dict(str, str) | request body
+ request_body = {'key': 'request_body_example'} # dict[str, str] | request body
try:
# test inline additionalProperties
@@ -1050,7 +1050,7 @@ with petstore_api.ApiClient() as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **request_body** | [**dict(str, str)**](str.md)| request body |
+ **request_body** | [**dict[str, str]**](str.md)| request body |
### Return type
@@ -1167,7 +1167,7 @@ http = ['http_example'] # list[str] |
url = ['url_example'] # list[str] |
context = ['context_example'] # list[str] |
allow_empty = 'allow_empty_example' # str |
-language = {'key': 'language_example'} # dict(str, str) | (optional)
+language = {'key': 'language_example'} # dict[str, str] | (optional)
try:
api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language=language)
@@ -1185,7 +1185,7 @@ Name | Type | Description | Notes
**url** | [**list[str]**](str.md)| |
**context** | [**list[str]**](str.md)| |
**allow_empty** | **str**| |
- **language** | [**dict(str, str)**](str.md)| | [optional]
+ **language** | [**dict[str, str]**](str.md)| | [optional]
### Return type
diff --git a/samples/openapi3/client/petstore/python-legacy/docs/MapTest.md b/samples/openapi3/client/petstore/python-legacy/docs/MapTest.md
index aea74bc8689..8f136137b52 100755
--- a/samples/openapi3/client/petstore/python-legacy/docs/MapTest.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/MapTest.md
@@ -4,10 +4,10 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**map_map_of_string** | **dict(str, dict(str, str))** | | [optional]
-**map_of_enum_string** | **dict(str, str)** | | [optional]
-**direct_map** | **dict(str, bool)** | | [optional]
-**indirect_map** | **dict(str, bool)** | | [optional]
+**map_map_of_string** | **dict[str, dict[str, str]]** | | [optional]
+**map_of_enum_string** | **dict[str, str]** | | [optional]
+**direct_map** | **dict[str, bool]** | | [optional]
+**indirect_map** | **dict[str, bool]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md
index 53e84e839bb..46fb6992509 100755
--- a/samples/openapi3/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **str** | | [optional]
**date_time** | **datetime** | | [optional]
-**map** | [**dict(str, Animal)**](Animal.md) | | [optional]
+**map** | [**dict[str, Animal]**](Animal.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-legacy/docs/NullableClass.md b/samples/openapi3/client/petstore/python-legacy/docs/NullableClass.md
index 64964d9bbdd..ef127e778e2 100755
--- a/samples/openapi3/client/petstore/python-legacy/docs/NullableClass.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/NullableClass.md
@@ -13,9 +13,9 @@ Name | Type | Description | Notes
**array_nullable_prop** | **list[object]** | | [optional]
**array_and_items_nullable_prop** | **list[object]** | | [optional]
**array_items_nullable** | **list[object]** | | [optional]
-**object_nullable_prop** | **dict(str, object)** | | [optional]
-**object_and_items_nullable_prop** | **dict(str, object)** | | [optional]
-**object_items_nullable** | **dict(str, object)** | | [optional]
+**object_nullable_prop** | **dict[str, object]** | | [optional]
+**object_and_items_nullable_prop** | **dict[str, object]** | | [optional]
+**object_items_nullable** | **dict[str, object]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/openapi3/client/petstore/python-legacy/docs/StoreApi.md b/samples/openapi3/client/petstore/python-legacy/docs/StoreApi.md
index 28975756fb5..b4e6d409c83 100755
--- a/samples/openapi3/client/petstore/python-legacy/docs/StoreApi.md
+++ b/samples/openapi3/client/petstore/python-legacy/docs/StoreApi.md
@@ -73,7 +73,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_inventory**
-> dict(str, int) get_inventory()
+> dict[str, int] get_inventory()
Returns pet inventories by status
@@ -123,7 +123,7 @@ This endpoint does not need any parameter.
### Return type
-**dict(str, int)**
+**dict[str, int]**
### Authorization
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py
index d0d098cc042..bb41ebddd78 100755
--- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py
@@ -2238,7 +2238,7 @@ class FakeApi(object):
>>> result = thread.get()
:param request_body: request body (required)
- :type request_body: dict(str, str)
+ :type request_body: dict[str, str]
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -2268,7 +2268,7 @@ class FakeApi(object):
>>> result = thread.get()
:param request_body: request body (required)
- :type request_body: dict(str, str)
+ :type request_body: dict[str, str]
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _return_http_data_only: response data without head status code
@@ -2538,7 +2538,7 @@ class FakeApi(object):
:param allow_empty: (required)
:type allow_empty: str
:param language:
- :type language: dict(str, str)
+ :type language: dict[str, str]
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -2580,7 +2580,7 @@ class FakeApi(object):
:param allow_empty: (required)
:type allow_empty: str
:param language:
- :type language: dict(str, str)
+ :type language: dict[str, str]
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _return_http_data_only: response data without head status code
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py
index 6e0af56af81..60655c93e34 100755
--- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py
@@ -190,7 +190,7 @@ class StoreApi(object):
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
- :rtype: dict(str, int)
+ :rtype: dict[str, int]
"""
kwargs['_return_http_data_only'] = True
return self.get_inventory_with_http_info(**kwargs) # noqa: E501
@@ -226,7 +226,7 @@ class StoreApi(object):
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
- :rtype: tuple(dict(str, int), status_code(int), headers(HTTPHeaderDict))
+ :rtype: tuple(dict[str, int], status_code(int), headers(HTTPHeaderDict))
"""
local_var_params = locals()
@@ -274,7 +274,7 @@ class StoreApi(object):
auth_settings = ['api_key'] # noqa: E501
response_types_map = {
- 200: "dict(str, int)",
+ 200: "dict[str, int]",
}
return self.api_client.call_api(
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api_client.py
index 10d903cb0df..294f6f87c73 100755
--- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api_client.py
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api_client.py
@@ -301,8 +301,8 @@ class ApiClient(object):
return [self.__deserialize(sub_data, sub_kls)
for sub_data in data]
- if klass.startswith('dict('):
- sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
+ if klass.startswith('dict['):
+ sub_kls = re.match(r'dict\[([^,]*), (.*)\]', klass).group(2)
return {k: self.__deserialize(v, sub_kls)
for k, v in six.iteritems(data)}
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py
index f8303e680b2..710807587e2 100755
--- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/additional_properties_class.py
@@ -36,8 +36,8 @@ class AdditionalPropertiesClass(object):
and the value is json key in definition.
"""
openapi_types = {
- 'map_property': 'dict(str, str)',
- 'map_of_map_property': 'dict(str, dict(str, str))'
+ 'map_property': 'dict[str, str]',
+ 'map_of_map_property': 'dict[str, dict[str, str]]'
}
attribute_map = {
@@ -66,7 +66,7 @@ class AdditionalPropertiesClass(object):
:return: The map_property of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, str)
+ :rtype: dict[str, str]
"""
return self._map_property
@@ -76,7 +76,7 @@ class AdditionalPropertiesClass(object):
:param map_property: The map_property of this AdditionalPropertiesClass. # noqa: E501
- :type map_property: dict(str, str)
+ :type map_property: dict[str, str]
"""
self._map_property = map_property
@@ -87,7 +87,7 @@ class AdditionalPropertiesClass(object):
:return: The map_of_map_property of this AdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, dict(str, str))
+ :rtype: dict[str, dict[str, str]]
"""
return self._map_of_map_property
@@ -97,7 +97,7 @@ class AdditionalPropertiesClass(object):
:param map_of_map_property: The map_of_map_property of this AdditionalPropertiesClass. # noqa: E501
- :type map_of_map_property: dict(str, dict(str, str))
+ :type map_of_map_property: dict[str, dict[str, str]]
"""
self._map_of_map_property = map_of_map_property
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/map_test.py
index 21bd2ccda98..606253a90d9 100755
--- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/map_test.py
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/map_test.py
@@ -36,10 +36,10 @@ class MapTest(object):
and the value is json key in definition.
"""
openapi_types = {
- 'map_map_of_string': 'dict(str, dict(str, str))',
- 'map_of_enum_string': 'dict(str, str)',
- 'direct_map': 'dict(str, bool)',
- 'indirect_map': 'dict(str, bool)'
+ 'map_map_of_string': 'dict[str, dict[str, str]]',
+ 'map_of_enum_string': 'dict[str, str]',
+ 'direct_map': 'dict[str, bool]',
+ 'indirect_map': 'dict[str, bool]'
}
attribute_map = {
@@ -76,7 +76,7 @@ class MapTest(object):
:return: The map_map_of_string of this MapTest. # noqa: E501
- :rtype: dict(str, dict(str, str))
+ :rtype: dict[str, dict[str, str]]
"""
return self._map_map_of_string
@@ -86,7 +86,7 @@ class MapTest(object):
:param map_map_of_string: The map_map_of_string of this MapTest. # noqa: E501
- :type map_map_of_string: dict(str, dict(str, str))
+ :type map_map_of_string: dict[str, dict[str, str]]
"""
self._map_map_of_string = map_map_of_string
@@ -97,7 +97,7 @@ class MapTest(object):
:return: The map_of_enum_string of this MapTest. # noqa: E501
- :rtype: dict(str, str)
+ :rtype: dict[str, str]
"""
return self._map_of_enum_string
@@ -107,7 +107,7 @@ class MapTest(object):
:param map_of_enum_string: The map_of_enum_string of this MapTest. # noqa: E501
- :type map_of_enum_string: dict(str, str)
+ :type map_of_enum_string: dict[str, str]
"""
allowed_values = ["UPPER", "lower"] # noqa: E501
if (self.local_vars_configuration.client_side_validation and
@@ -126,7 +126,7 @@ class MapTest(object):
:return: The direct_map of this MapTest. # noqa: E501
- :rtype: dict(str, bool)
+ :rtype: dict[str, bool]
"""
return self._direct_map
@@ -136,7 +136,7 @@ class MapTest(object):
:param direct_map: The direct_map of this MapTest. # noqa: E501
- :type direct_map: dict(str, bool)
+ :type direct_map: dict[str, bool]
"""
self._direct_map = direct_map
@@ -147,7 +147,7 @@ class MapTest(object):
:return: The indirect_map of this MapTest. # noqa: E501
- :rtype: dict(str, bool)
+ :rtype: dict[str, bool]
"""
return self._indirect_map
@@ -157,7 +157,7 @@ class MapTest(object):
:param indirect_map: The indirect_map of this MapTest. # noqa: E501
- :type indirect_map: dict(str, bool)
+ :type indirect_map: dict[str, bool]
"""
self._indirect_map = indirect_map
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py
index 9e727b07d5c..96aedc145c4 100755
--- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/mixed_properties_and_additional_properties_class.py
@@ -38,7 +38,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
openapi_types = {
'uuid': 'str',
'date_time': 'datetime',
- 'map': 'dict(str, Animal)'
+ 'map': 'dict[str, Animal]'
}
attribute_map = {
@@ -113,7 +113,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
:return: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
- :rtype: dict(str, Animal)
+ :rtype: dict[str, Animal]
"""
return self._map
@@ -123,7 +123,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
:param map: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
- :type map: dict(str, Animal)
+ :type map: dict[str, Animal]
"""
self._map = map
diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/nullable_class.py
index d36862f8526..45f06542661 100755
--- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/nullable_class.py
+++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/nullable_class.py
@@ -45,9 +45,9 @@ class NullableClass(object):
'array_nullable_prop': 'list[object]',
'array_and_items_nullable_prop': 'list[object]',
'array_items_nullable': 'list[object]',
- 'object_nullable_prop': 'dict(str, object)',
- 'object_and_items_nullable_prop': 'dict(str, object)',
- 'object_items_nullable': 'dict(str, object)'
+ 'object_nullable_prop': 'dict[str, object]',
+ 'object_and_items_nullable_prop': 'dict[str, object]',
+ 'object_items_nullable': 'dict[str, object]'
}
attribute_map = {
@@ -295,7 +295,7 @@ class NullableClass(object):
:return: The object_nullable_prop of this NullableClass. # noqa: E501
- :rtype: dict(str, object)
+ :rtype: dict[str, object]
"""
return self._object_nullable_prop
@@ -305,7 +305,7 @@ class NullableClass(object):
:param object_nullable_prop: The object_nullable_prop of this NullableClass. # noqa: E501
- :type object_nullable_prop: dict(str, object)
+ :type object_nullable_prop: dict[str, object]
"""
self._object_nullable_prop = object_nullable_prop
@@ -316,7 +316,7 @@ class NullableClass(object):
:return: The object_and_items_nullable_prop of this NullableClass. # noqa: E501
- :rtype: dict(str, object)
+ :rtype: dict[str, object]
"""
return self._object_and_items_nullable_prop
@@ -326,7 +326,7 @@ class NullableClass(object):
:param object_and_items_nullable_prop: The object_and_items_nullable_prop of this NullableClass. # noqa: E501
- :type object_and_items_nullable_prop: dict(str, object)
+ :type object_and_items_nullable_prop: dict[str, object]
"""
self._object_and_items_nullable_prop = object_and_items_nullable_prop
@@ -337,7 +337,7 @@ class NullableClass(object):
:return: The object_items_nullable of this NullableClass. # noqa: E501
- :rtype: dict(str, object)
+ :rtype: dict[str, object]
"""
return self._object_items_nullable
@@ -347,7 +347,7 @@ class NullableClass(object):
:param object_items_nullable: The object_items_nullable of this NullableClass. # noqa: E501
- :type object_items_nullable: dict(str, object)
+ :type object_items_nullable: dict[str, object]
"""
self._object_items_nullable = object_items_nullable
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/.github/workflows/python.yml b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.github/workflows/python.yml
new file mode 100644
index 00000000000..28a13b8f38e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.github/workflows/python.yml
@@ -0,0 +1,37 @@
+# NOTE: This file is auto generated by OpenAPI Generator.
+# URL: https://openapi-generator.tech
+#
+# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
+
+name: petstore_api Python package
+
+on: [push, pull_request]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: ["3.7", "3.8", "3.9", "3.10"]
+
+ steps:s
+ - uses: actions/checkout@v3
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}s
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install flake8 pytest
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+ - name: Lint with flake8
+ run: |
+ # stop the build if there are Python syntax errors or undefined names
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
+ - name: Test with pytest
+ run: |
+ pytest
\ No newline at end of file
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/.gitignore b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.gitignore
new file mode 100644
index 00000000000..43995bd42fa
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.gitignore
@@ -0,0 +1,66 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+.hypothesis/
+venv/
+.venv/
+.python-version
+.pytest_cache
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+#Ipython Notebook
+.ipynb_checkpoints
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.gitlab-ci.yml
new file mode 100644
index 00000000000..1d94e384696
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.gitlab-ci.yml
@@ -0,0 +1,25 @@
+# NOTE: This file is auto generated by OpenAPI Generator.
+# URL: https://openapi-generator.tech
+#
+# ref: https://docs.gitlab.com/ee/ci/README.html
+# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
+
+stages:
+ - test
+
+.pytest:
+ stage: test
+ script:
+ - pip install -r requirements.txt
+ - pip install -r test-requirements.txt
+ - pytest --cov=petstore_api
+
+pytest-3.7:
+ extends: .pytest
+ image: python:3.7-alpine
+pytest-3.8:
+ extends: .pytest
+ image: python:3.8-alpine
+pytest-3.9:
+ extends: .pytest
+ image: python:3.9-alpine
\ No newline at end of file
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/.openapi-generator-ignore b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.openapi-generator-ignore
new file mode 100644
index 00000000000..7484ee590a3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.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/openapi3/client/petstore/python-nextgen-aiohttp/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.openapi-generator/FILES
new file mode 100644
index 00000000000..7bb4db01ebf
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.openapi-generator/FILES
@@ -0,0 +1,146 @@
+.github/workflows/python.yml
+.gitignore
+.gitlab-ci.yml
+.travis.yml
+README.md
+docs/AdditionalPropertiesClass.md
+docs/AllOfWithSingleRef.md
+docs/Animal.md
+docs/AnotherFakeApi.md
+docs/AnyOfPig.md
+docs/ApiResponse.md
+docs/ArrayOfArrayOfNumberOnly.md
+docs/ArrayOfNumberOnly.md
+docs/ArrayTest.md
+docs/BasquePig.md
+docs/Capitalization.md
+docs/Cat.md
+docs/CatAllOf.md
+docs/Category.md
+docs/ClassModel.md
+docs/Client.md
+docs/DanishPig.md
+docs/DefaultApi.md
+docs/DeprecatedObject.md
+docs/Dog.md
+docs/DogAllOf.md
+docs/DummyModel.md
+docs/EnumArrays.md
+docs/EnumClass.md
+docs/EnumTest.md
+docs/FakeApi.md
+docs/FakeClassnameTags123Api.md
+docs/File.md
+docs/FileSchemaTestClass.md
+docs/Foo.md
+docs/FooGetDefaultResponse.md
+docs/FormatTest.md
+docs/HasOnlyReadOnly.md
+docs/HealthCheckResult.md
+docs/List.md
+docs/MapTest.md
+docs/MixedPropertiesAndAdditionalPropertiesClass.md
+docs/Model200Response.md
+docs/ModelReturn.md
+docs/Name.md
+docs/NullableClass.md
+docs/NumberOnly.md
+docs/ObjectWithDeprecatedFields.md
+docs/Order.md
+docs/OuterComposite.md
+docs/OuterEnum.md
+docs/OuterEnumDefaultValue.md
+docs/OuterEnumInteger.md
+docs/OuterEnumIntegerDefaultValue.md
+docs/OuterObjectWithEnumProperty.md
+docs/Pet.md
+docs/PetApi.md
+docs/Pig.md
+docs/ReadOnlyFirst.md
+docs/SelfReferenceModel.md
+docs/SingleRefType.md
+docs/SpecialModelName.md
+docs/SpecialName.md
+docs/StoreApi.md
+docs/Tag.md
+docs/User.md
+docs/UserApi.md
+docs/WithNestedOneOf.md
+git_push.sh
+petstore_api/__init__.py
+petstore_api/api/__init__.py
+petstore_api/api/another_fake_api.py
+petstore_api/api/default_api.py
+petstore_api/api/fake_api.py
+petstore_api/api/fake_classname_tags123_api.py
+petstore_api/api/pet_api.py
+petstore_api/api/store_api.py
+petstore_api/api/user_api.py
+petstore_api/api_client.py
+petstore_api/configuration.py
+petstore_api/exceptions.py
+petstore_api/models/__init__.py
+petstore_api/models/additional_properties_class.py
+petstore_api/models/all_of_with_single_ref.py
+petstore_api/models/animal.py
+petstore_api/models/any_of_pig.py
+petstore_api/models/api_response.py
+petstore_api/models/array_of_array_of_number_only.py
+petstore_api/models/array_of_number_only.py
+petstore_api/models/array_test.py
+petstore_api/models/basque_pig.py
+petstore_api/models/capitalization.py
+petstore_api/models/cat.py
+petstore_api/models/cat_all_of.py
+petstore_api/models/category.py
+petstore_api/models/class_model.py
+petstore_api/models/client.py
+petstore_api/models/danish_pig.py
+petstore_api/models/deprecated_object.py
+petstore_api/models/dog.py
+petstore_api/models/dog_all_of.py
+petstore_api/models/dummy_model.py
+petstore_api/models/enum_arrays.py
+petstore_api/models/enum_class.py
+petstore_api/models/enum_test.py
+petstore_api/models/file.py
+petstore_api/models/file_schema_test_class.py
+petstore_api/models/foo.py
+petstore_api/models/foo_get_default_response.py
+petstore_api/models/format_test.py
+petstore_api/models/has_only_read_only.py
+petstore_api/models/health_check_result.py
+petstore_api/models/list.py
+petstore_api/models/map_test.py
+petstore_api/models/mixed_properties_and_additional_properties_class.py
+petstore_api/models/model200_response.py
+petstore_api/models/model_return.py
+petstore_api/models/name.py
+petstore_api/models/nullable_class.py
+petstore_api/models/number_only.py
+petstore_api/models/object_with_deprecated_fields.py
+petstore_api/models/order.py
+petstore_api/models/outer_composite.py
+petstore_api/models/outer_enum.py
+petstore_api/models/outer_enum_default_value.py
+petstore_api/models/outer_enum_integer.py
+petstore_api/models/outer_enum_integer_default_value.py
+petstore_api/models/outer_object_with_enum_property.py
+petstore_api/models/pet.py
+petstore_api/models/pig.py
+petstore_api/models/read_only_first.py
+petstore_api/models/self_reference_model.py
+petstore_api/models/single_ref_type.py
+petstore_api/models/special_model_name.py
+petstore_api/models/special_name.py
+petstore_api/models/tag.py
+petstore_api/models/user.py
+petstore_api/models/with_nested_one_of.py
+petstore_api/rest.py
+petstore_api/signing.py
+requirements.txt
+setup.cfg
+setup.py
+test-requirements.txt
+test/__init__.py
+tox.ini
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.openapi-generator/VERSION
new file mode 100644
index 00000000000..d6b4ec4aa78
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.openapi-generator/VERSION
@@ -0,0 +1 @@
+6.3.0-SNAPSHOT
\ No newline at end of file
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/.travis.yml b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.travis.yml
new file mode 100644
index 00000000000..bb28138c5b1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.travis.yml
@@ -0,0 +1,17 @@
+# ref: https://docs.travis-ci.com/user/languages/python
+language: python
+python:
+ - "3.7"
+ - "3.8"
+ - "3.9"
+ - "3.10"
+ - "3.11"
+ # uncomment the following if needed
+ #- "3.11-dev" # 3.11 development branch
+ #- "nightly" # nightly build
+# command to install dependencies
+install:
+ - "pip install -r requirements.txt"
+ - "pip install -r test-requirements.txt"
+# command to run tests
+script: pytest --cov=petstore_api
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/README.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/README.md
new file mode 100644
index 00000000000..aa2751c2aec
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/README.md
@@ -0,0 +1,232 @@
+# petstore-api
+This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: 1.0.0
+- Package version: 1.0.0
+- Build package: org.openapitools.codegen.languages.PythonNextgenClientCodegen
+
+## Requirements.
+
+Python 3.7+
+
+## Installation & Usage
+### pip install
+
+If the python package is hosted on a repository, you can install directly using:
+
+```sh
+pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
+```
+(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
+
+Then import the package:
+```python
+import petstore_api
+```
+
+### Setuptools
+
+Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
+
+```sh
+python setup.py install --user
+```
+(or `sudo python setup.py install` to install the package for all users)
+
+Then import the package:
+```python
+import petstore_api
+```
+
+## Getting Started
+
+Please follow the [installation procedure](#installation--usage) and then run the following:
+
+```python
+from __future__ import print_function
+import datetime
+import time
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.AnotherFakeApi(api_client)
+ client = petstore_api.Client() # Client | client model
+
+ try:
+ # To test special tags
+ api_response = await api_instance.call_123_test_special_tags(client)
+ print("The response of AnotherFakeApi->call_123_test_special_tags:\n")
+ pprint(api_response)
+ except ApiException as e:
+ print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
+
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
+*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo |
+*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
+*FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication
+*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
+*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
+*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
+*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
+*FakeApi* | [**fake_property_enum_integer_serialize**](docs/FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int |
+*FakeApi* | [**test_body_with_binary**](docs/FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary |
+*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
+*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
+*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
+*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
+*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
+*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
+*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters |
+*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case
+*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
+*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
+*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
+*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
+*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
+*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
+*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
+*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
+*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
+*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
+*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID
+*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
+*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user
+*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array
+*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array
+*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user
+*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name
+*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system
+*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session
+*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user
+
+
+## Documentation For Models
+
+ - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
+ - [AllOfWithSingleRef](docs/AllOfWithSingleRef.md)
+ - [Animal](docs/Animal.md)
+ - [AnyOfPig](docs/AnyOfPig.md)
+ - [ApiResponse](docs/ApiResponse.md)
+ - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
+ - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
+ - [ArrayTest](docs/ArrayTest.md)
+ - [BasquePig](docs/BasquePig.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)
+ - [DanishPig](docs/DanishPig.md)
+ - [DeprecatedObject](docs/DeprecatedObject.md)
+ - [Dog](docs/Dog.md)
+ - [DogAllOf](docs/DogAllOf.md)
+ - [DummyModel](docs/DummyModel.md)
+ - [EnumArrays](docs/EnumArrays.md)
+ - [EnumClass](docs/EnumClass.md)
+ - [EnumTest](docs/EnumTest.md)
+ - [File](docs/File.md)
+ - [FileSchemaTestClass](docs/FileSchemaTestClass.md)
+ - [Foo](docs/Foo.md)
+ - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md)
+ - [FormatTest](docs/FormatTest.md)
+ - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
+ - [HealthCheckResult](docs/HealthCheckResult.md)
+ - [List](docs/List.md)
+ - [MapTest](docs/MapTest.md)
+ - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
+ - [Model200Response](docs/Model200Response.md)
+ - [ModelReturn](docs/ModelReturn.md)
+ - [Name](docs/Name.md)
+ - [NullableClass](docs/NullableClass.md)
+ - [NumberOnly](docs/NumberOnly.md)
+ - [ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md)
+ - [Order](docs/Order.md)
+ - [OuterComposite](docs/OuterComposite.md)
+ - [OuterEnum](docs/OuterEnum.md)
+ - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md)
+ - [OuterEnumInteger](docs/OuterEnumInteger.md)
+ - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
+ - [OuterObjectWithEnumProperty](docs/OuterObjectWithEnumProperty.md)
+ - [Pet](docs/Pet.md)
+ - [Pig](docs/Pig.md)
+ - [ReadOnlyFirst](docs/ReadOnlyFirst.md)
+ - [SelfReferenceModel](docs/SelfReferenceModel.md)
+ - [SingleRefType](docs/SingleRefType.md)
+ - [SpecialModelName](docs/SpecialModelName.md)
+ - [SpecialName](docs/SpecialName.md)
+ - [Tag](docs/Tag.md)
+ - [User](docs/User.md)
+ - [WithNestedOneOf](docs/WithNestedOneOf.md)
+
+
+## Documentation For Authorization
+
+
+## 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
+
+
+## bearer_test
+
+- **Type**: Bearer authentication (JWT)
+
+
+## http_basic_test
+
+- **Type**: HTTP basic authentication
+
+
+## http_signature_test
+
+
+
+## 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
+
+
+## Author
+
+
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/dev-requirements.txt b/samples/openapi3/client/petstore/python-nextgen-aiohttp/dev-requirements.txt
new file mode 100755
index 00000000000..ccdfca62949
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/dev-requirements.txt
@@ -0,0 +1,2 @@
+tox
+flake8
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/AdditionalPropertiesClass.md
new file mode 100644
index 00000000000..6abc3136b9c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/AdditionalPropertiesClass.md
@@ -0,0 +1,29 @@
+# AdditionalPropertiesClass
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**map_property** | **Dict[str, str]** | | [optional]
+**map_of_map_property** | **Dict[str, Dict[str, str]]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AdditionalPropertiesClass from a JSON string
+additional_properties_class_instance = AdditionalPropertiesClass.from_json(json)
+# print the JSON string representation of the object
+print AdditionalPropertiesClass.to_json()
+
+# convert the object into a dict
+additional_properties_class_dict = additional_properties_class_instance.to_dict()
+# create an instance of AdditionalPropertiesClass from a dict
+additional_properties_class_form_dict = additional_properties_class.from_dict(additional_properties_class_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/AllOfWithSingleRef.md
new file mode 100644
index 00000000000..1a8b4df7ecc
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/AllOfWithSingleRef.md
@@ -0,0 +1,29 @@
+# AllOfWithSingleRef
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**username** | **str** | | [optional]
+**single_ref_type** | [**SingleRefType**](SingleRefType.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AllOfWithSingleRef from a JSON string
+all_of_with_single_ref_instance = AllOfWithSingleRef.from_json(json)
+# print the JSON string representation of the object
+print AllOfWithSingleRef.to_json()
+
+# convert the object into a dict
+all_of_with_single_ref_dict = all_of_with_single_ref_instance.to_dict()
+# create an instance of AllOfWithSingleRef from a dict
+all_of_with_single_ref_form_dict = all_of_with_single_ref.from_dict(all_of_with_single_ref_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Animal.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Animal.md
new file mode 100644
index 00000000000..b62f1969099
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Animal.md
@@ -0,0 +1,29 @@
+# Animal
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
+**color** | **str** | | [optional] [default to 'red']
+
+## Example
+
+```python
+from petstore_api.models.animal import Animal
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Animal from a JSON string
+animal_instance = Animal.from_json(json)
+# print the JSON string representation of the object
+print Animal.to_json()
+
+# convert the object into a dict
+animal_dict = animal_instance.to_dict()
+# create an instance of Animal from a dict
+animal_form_dict = animal.from_dict(animal_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/AnotherFakeApi.md
new file mode 100644
index 00000000000..1fd1a5a9a19
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/AnotherFakeApi.md
@@ -0,0 +1,73 @@
+# petstore_api.AnotherFakeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
+
+
+# **call_123_test_special_tags**
+> Client call_123_test_special_tags(client)
+
+To test special tags
+
+To test special tags and operation ID starting with number
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.AnotherFakeApi(api_client)
+ client = petstore_api.Client() # Client | client model
+
+ try:
+ # To test special tags
+ api_response = await api_instance.call_123_test_special_tags(client)
+ print("The response of AnotherFakeApi->call_123_test_special_tags:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **client** | [**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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/AnyOfPig.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/AnyOfPig.md
new file mode 100644
index 00000000000..2da7ca6eefe
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/AnyOfPig.md
@@ -0,0 +1,30 @@
+# AnyOfPig
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
+**color** | **str** | |
+**size** | **int** | |
+
+## Example
+
+```python
+from petstore_api.models.any_of_pig import AnyOfPig
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AnyOfPig from a JSON string
+any_of_pig_instance = AnyOfPig.from_json(json)
+# print the JSON string representation of the object
+print AnyOfPig.to_json()
+
+# convert the object into a dict
+any_of_pig_dict = any_of_pig_instance.to_dict()
+# create an instance of AnyOfPig from a dict
+any_of_pig_form_dict = any_of_pig.from_dict(any_of_pig_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ApiResponse.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ApiResponse.md
new file mode 100644
index 00000000000..ba35ea9e2f0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ApiResponse.md
@@ -0,0 +1,30 @@
+# ApiResponse
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **int** | | [optional]
+**type** | **str** | | [optional]
+**message** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.api_response import ApiResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ApiResponse from a JSON string
+api_response_instance = ApiResponse.from_json(json)
+# print the JSON string representation of the object
+print ApiResponse.to_json()
+
+# convert the object into a dict
+api_response_dict = api_response_instance.to_dict()
+# create an instance of ApiResponse from a dict
+api_response_form_dict = api_response.from_dict(api_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ArrayOfArrayOfNumberOnly.md
new file mode 100644
index 00000000000..3f0c127d4fa
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ArrayOfArrayOfNumberOnly.md
@@ -0,0 +1,28 @@
+# ArrayOfArrayOfNumberOnly
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**array_array_number** | **List[List[float]]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ArrayOfArrayOfNumberOnly from a JSON string
+array_of_array_of_number_only_instance = ArrayOfArrayOfNumberOnly.from_json(json)
+# print the JSON string representation of the object
+print ArrayOfArrayOfNumberOnly.to_json()
+
+# convert the object into a dict
+array_of_array_of_number_only_dict = array_of_array_of_number_only_instance.to_dict()
+# create an instance of ArrayOfArrayOfNumberOnly from a dict
+array_of_array_of_number_only_form_dict = array_of_array_of_number_only.from_dict(array_of_array_of_number_only_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ArrayOfNumberOnly.md
new file mode 100644
index 00000000000..c10191915a7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ArrayOfNumberOnly.md
@@ -0,0 +1,28 @@
+# ArrayOfNumberOnly
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**array_number** | **List[float]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ArrayOfNumberOnly from a JSON string
+array_of_number_only_instance = ArrayOfNumberOnly.from_json(json)
+# print the JSON string representation of the object
+print ArrayOfNumberOnly.to_json()
+
+# convert the object into a dict
+array_of_number_only_dict = array_of_number_only_instance.to_dict()
+# create an instance of ArrayOfNumberOnly from a dict
+array_of_number_only_form_dict = array_of_number_only.from_dict(array_of_number_only_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ArrayTest.md
new file mode 100644
index 00000000000..0a40fb36d26
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ArrayTest.md
@@ -0,0 +1,30 @@
+# ArrayTest
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**array_of_string** | **List[str]** | | [optional]
+**array_array_of_integer** | **List[List[int]]** | | [optional]
+**array_array_of_model** | **List[List[ReadOnlyFirst]]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.array_test import ArrayTest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ArrayTest from a JSON string
+array_test_instance = ArrayTest.from_json(json)
+# print the JSON string representation of the object
+print ArrayTest.to_json()
+
+# convert the object into a dict
+array_test_dict = array_test_instance.to_dict()
+# create an instance of ArrayTest from a dict
+array_test_form_dict = array_test.from_dict(array_test_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/BasquePig.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/BasquePig.md
new file mode 100644
index 00000000000..552b9390c7e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/BasquePig.md
@@ -0,0 +1,29 @@
+# BasquePig
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
+**color** | **str** | |
+
+## Example
+
+```python
+from petstore_api.models.basque_pig import BasquePig
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of BasquePig from a JSON string
+basque_pig_instance = BasquePig.from_json(json)
+# print the JSON string representation of the object
+print BasquePig.to_json()
+
+# convert the object into a dict
+basque_pig_dict = basque_pig_instance.to_dict()
+# create an instance of BasquePig from a dict
+basque_pig_form_dict = basque_pig.from_dict(basque_pig_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Capitalization.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Capitalization.md
new file mode 100644
index 00000000000..99e6fae88fd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Capitalization.md
@@ -0,0 +1,33 @@
+# Capitalization
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**small_camel** | **str** | | [optional]
+**capital_camel** | **str** | | [optional]
+**small_snake** | **str** | | [optional]
+**capital_snake** | **str** | | [optional]
+**sca_eth_flow_points** | **str** | | [optional]
+**att_name** | **str** | Name of the pet | [optional]
+
+## Example
+
+```python
+from petstore_api.models.capitalization import Capitalization
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Capitalization from a JSON string
+capitalization_instance = Capitalization.from_json(json)
+# print the JSON string representation of the object
+print Capitalization.to_json()
+
+# convert the object into a dict
+capitalization_dict = capitalization_instance.to_dict()
+# create an instance of Capitalization from a dict
+capitalization_form_dict = capitalization.from_dict(capitalization_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Cat.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Cat.md
new file mode 100644
index 00000000000..4b509dda7ea
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Cat.md
@@ -0,0 +1,28 @@
+# Cat
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**declawed** | **bool** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.cat import Cat
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Cat from a JSON string
+cat_instance = Cat.from_json(json)
+# print the JSON string representation of the object
+print Cat.to_json()
+
+# convert the object into a dict
+cat_dict = cat_instance.to_dict()
+# create an instance of Cat from a dict
+cat_form_dict = cat.from_dict(cat_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/CatAllOf.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/CatAllOf.md
new file mode 100644
index 00000000000..dcae5facb94
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/CatAllOf.md
@@ -0,0 +1,28 @@
+# CatAllOf
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**declawed** | **bool** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.cat_all_of import CatAllOf
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CatAllOf from a JSON string
+cat_all_of_instance = CatAllOf.from_json(json)
+# print the JSON string representation of the object
+print CatAllOf.to_json()
+
+# convert the object into a dict
+cat_all_of_dict = cat_all_of_instance.to_dict()
+# create an instance of CatAllOf from a dict
+cat_all_of_form_dict = cat_all_of.from_dict(cat_all_of_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Category.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Category.md
new file mode 100644
index 00000000000..c49514ef802
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Category.md
@@ -0,0 +1,29 @@
+# Category
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**name** | **str** | | [default to 'default-name']
+
+## Example
+
+```python
+from petstore_api.models.category import Category
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Category from a JSON string
+category_instance = Category.from_json(json)
+# print the JSON string representation of the object
+print Category.to_json()
+
+# convert the object into a dict
+category_dict = category_instance.to_dict()
+# create an instance of Category from a dict
+category_form_dict = category.from_dict(category_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ClassModel.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ClassModel.md
new file mode 100644
index 00000000000..1b6fb7cfc77
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ClassModel.md
@@ -0,0 +1,29 @@
+# ClassModel
+
+Model for testing model with \"_class\" property
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**var_class** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.class_model import ClassModel
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ClassModel from a JSON string
+class_model_instance = ClassModel.from_json(json)
+# print the JSON string representation of the object
+print ClassModel.to_json()
+
+# convert the object into a dict
+class_model_dict = class_model_instance.to_dict()
+# create an instance of ClassModel from a dict
+class_model_form_dict = class_model.from_dict(class_model_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Client.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Client.md
new file mode 100644
index 00000000000..b0ded10dd76
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Client.md
@@ -0,0 +1,28 @@
+# Client
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**client** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.client import Client
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Client from a JSON string
+client_instance = Client.from_json(json)
+# print the JSON string representation of the object
+print Client.to_json()
+
+# convert the object into a dict
+client_dict = client_instance.to_dict()
+# create an instance of Client from a dict
+client_form_dict = client.from_dict(client_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DanishPig.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DanishPig.md
new file mode 100644
index 00000000000..253616c2fc3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DanishPig.md
@@ -0,0 +1,29 @@
+# DanishPig
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
+**size** | **int** | |
+
+## Example
+
+```python
+from petstore_api.models.danish_pig import DanishPig
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DanishPig from a JSON string
+danish_pig_instance = DanishPig.from_json(json)
+# print the JSON string representation of the object
+print DanishPig.to_json()
+
+# convert the object into a dict
+danish_pig_dict = danish_pig_instance.to_dict()
+# create an instance of DanishPig from a dict
+danish_pig_form_dict = danish_pig.from_dict(danish_pig_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DefaultApi.md
new file mode 100644
index 00000000000..41dcdbd8631
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DefaultApi.md
@@ -0,0 +1,66 @@
+# petstore_api.DefaultApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**foo_get**](DefaultApi.md#foo_get) | **GET** /foo |
+
+
+# **foo_get**
+> FooGetDefaultResponse foo_get()
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.DefaultApi(api_client)
+
+ try:
+ api_response = await api_instance.foo_get()
+ print("The response of DefaultApi->foo_get:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling DefaultApi->foo_get: %s\n" % e)
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**FooGetDefaultResponse**](FooGetDefaultResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**0** | response | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DeprecatedObject.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DeprecatedObject.md
new file mode 100644
index 00000000000..e6cf5718963
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DeprecatedObject.md
@@ -0,0 +1,28 @@
+# DeprecatedObject
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.deprecated_object import DeprecatedObject
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DeprecatedObject from a JSON string
+deprecated_object_instance = DeprecatedObject.from_json(json)
+# print the JSON string representation of the object
+print DeprecatedObject.to_json()
+
+# convert the object into a dict
+deprecated_object_dict = deprecated_object_instance.to_dict()
+# create an instance of DeprecatedObject from a dict
+deprecated_object_form_dict = deprecated_object.from_dict(deprecated_object_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Dog.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Dog.md
new file mode 100644
index 00000000000..3469be73a76
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Dog.md
@@ -0,0 +1,28 @@
+# Dog
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**breed** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.dog import Dog
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Dog from a JSON string
+dog_instance = Dog.from_json(json)
+# print the JSON string representation of the object
+print Dog.to_json()
+
+# convert the object into a dict
+dog_dict = dog_instance.to_dict()
+# create an instance of Dog from a dict
+dog_form_dict = dog.from_dict(dog_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DogAllOf.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DogAllOf.md
new file mode 100644
index 00000000000..759bdd781b0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DogAllOf.md
@@ -0,0 +1,28 @@
+# DogAllOf
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**breed** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.dog_all_of import DogAllOf
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DogAllOf from a JSON string
+dog_all_of_instance = DogAllOf.from_json(json)
+# print the JSON string representation of the object
+print DogAllOf.to_json()
+
+# convert the object into a dict
+dog_all_of_dict = dog_all_of_instance.to_dict()
+# create an instance of DogAllOf from a dict
+dog_all_of_form_dict = dog_all_of.from_dict(dog_all_of_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DummyModel.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DummyModel.md
new file mode 100644
index 00000000000..e690a8874f8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DummyModel.md
@@ -0,0 +1,29 @@
+# DummyModel
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**category** | **str** | | [optional]
+**self_ref** | [**SelfReferenceModel**](SelfReferenceModel.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.dummy_model import DummyModel
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DummyModel from a JSON string
+dummy_model_instance = DummyModel.from_json(json)
+# print the JSON string representation of the object
+print DummyModel.to_json()
+
+# convert the object into a dict
+dummy_model_dict = dummy_model_instance.to_dict()
+# create an instance of DummyModel from a dict
+dummy_model_form_dict = dummy_model.from_dict(dummy_model_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/EnumArrays.md
new file mode 100644
index 00000000000..d21f58a6608
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/EnumArrays.md
@@ -0,0 +1,29 @@
+# EnumArrays
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**just_symbol** | **str** | | [optional]
+**array_enum** | **List[str]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.enum_arrays import EnumArrays
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of EnumArrays from a JSON string
+enum_arrays_instance = EnumArrays.from_json(json)
+# print the JSON string representation of the object
+print EnumArrays.to_json()
+
+# convert the object into a dict
+enum_arrays_dict = enum_arrays_instance.to_dict()
+# create an instance of EnumArrays from a dict
+enum_arrays_form_dict = enum_arrays.from_dict(enum_arrays_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/EnumClass.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/EnumClass.md
new file mode 100644
index 00000000000..64830e3d1de
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/EnumClass.md
@@ -0,0 +1,10 @@
+# EnumClass
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/EnumTest.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/EnumTest.md
new file mode 100644
index 00000000000..3c900769031
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/EnumTest.md
@@ -0,0 +1,35 @@
+# EnumTest
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**enum_string** | **str** | | [optional]
+**enum_string_required** | **str** | |
+**enum_integer** | **int** | | [optional]
+**enum_number** | **float** | | [optional]
+**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional]
+**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional]
+**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional]
+**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.enum_test import EnumTest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of EnumTest from a JSON string
+enum_test_instance = EnumTest.from_json(json)
+# print the JSON string representation of the object
+print EnumTest.to_json()
+
+# convert the object into a dict
+enum_test_dict = enum_test_instance.to_dict()
+# create an instance of EnumTest from a dict
+enum_test_form_dict = enum_test.from_dict(enum_test_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeApi.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeApi.md
new file mode 100644
index 00000000000..a8500c31411
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeApi.md
@@ -0,0 +1,1153 @@
+# petstore_api.FakeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
+[**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication
+[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
+[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
+[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
+[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
+[**fake_property_enum_integer_serialize**](FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int |
+[**test_body_with_binary**](FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary |
+[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
+[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
+[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
+[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
+[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
+[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
+[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters |
+
+
+# **fake_health_get**
+> HealthCheckResult fake_health_get()
+
+Health check endpoint
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+
+ try:
+ # Health check endpoint
+ api_response = await api_instance.fake_health_get()
+ print("The response of FakeApi->fake_health_get:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_health_get: %s\n" % e)
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**HealthCheckResult**](HealthCheckResult.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | The instance started successfully | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_http_signature_test**
+> fake_http_signature_test(pet, query_1=query_1, header_1=header_1)
+
+test http signature authentication
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+ query_1 = 'query_1_example' # str | query parameter (optional)
+ header_1 = 'header_1_example' # str | header parameter (optional)
+
+ try:
+ # test http signature authentication
+ await api_instance.fake_http_signature_test(pet, query_1=query_1, header_1=header_1)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_http_signature_test: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+ **query_1** | **str**| query parameter | [optional]
+ **header_1** | **str**| header parameter | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | The instance started successfully | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_outer_boolean_serialize**
+> bool fake_outer_boolean_serialize(body=body)
+
+
+
+Test serialization of outer boolean types
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ body = True # bool | Input boolean as post body (optional)
+
+ try:
+ api_response = await api_instance.fake_outer_boolean_serialize(body=body)
+ print("The response of FakeApi->fake_outer_boolean_serialize:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **bool**| Input boolean as post body | [optional]
+
+### Return type
+
+**bool**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output boolean | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_outer_composite_serialize**
+> OuterComposite fake_outer_composite_serialize(outer_composite=outer_composite)
+
+
+
+Test serialization of object with outer number type
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ outer_composite = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional)
+
+ try:
+ api_response = await api_instance.fake_outer_composite_serialize(outer_composite=outer_composite)
+ print("The response of FakeApi->fake_outer_composite_serialize:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
+
+### Return type
+
+[**OuterComposite**](OuterComposite.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output composite | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_outer_number_serialize**
+> float fake_outer_number_serialize(body=body)
+
+
+
+Test serialization of outer number types
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ body = 3.4 # float | Input number as post body (optional)
+
+ try:
+ api_response = await api_instance.fake_outer_number_serialize(body=body)
+ print("The response of FakeApi->fake_outer_number_serialize:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **float**| Input number as post body | [optional]
+
+### Return type
+
+**float**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output number | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_outer_string_serialize**
+> str fake_outer_string_serialize(body=body)
+
+
+
+Test serialization of outer string types
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ body = 'body_example' # str | Input string as post body (optional)
+
+ try:
+ api_response = await api_instance.fake_outer_string_serialize(body=body)
+ print("The response of FakeApi->fake_outer_string_serialize:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **str**| Input string as post body | [optional]
+
+### Return type
+
+**str**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output string | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_property_enum_integer_serialize**
+> OuterObjectWithEnumProperty fake_property_enum_integer_serialize(outer_object_with_enum_property)
+
+
+
+Test serialization of enum (int) properties with examples
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ outer_object_with_enum_property = petstore_api.OuterObjectWithEnumProperty() # OuterObjectWithEnumProperty | Input enum (int) as post body
+
+ try:
+ api_response = await api_instance.fake_property_enum_integer_serialize(outer_object_with_enum_property)
+ print("The response of FakeApi->fake_property_enum_integer_serialize:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_property_enum_integer_serialize: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **outer_object_with_enum_property** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body |
+
+### Return type
+
+[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output enum (int) | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_body_with_binary**
+> test_body_with_binary(body)
+
+
+
+For this test, the body has to be a binary file.
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ body = 'body_example' # str | image to upload
+
+ try:
+ await api_instance.test_body_with_binary(body)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_body_with_binary: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **str**| image to upload |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: image/png
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_body_with_file_schema**
+> test_body_with_file_schema(file_schema_test_class)
+
+
+
+For this test, the body for this request must reference a schema named `File`.
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ file_schema_test_class = petstore_api.FileSchemaTestClass() # FileSchemaTestClass |
+
+ try:
+ await api_instance.test_body_with_file_schema(file_schema_test_class)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_body_with_query_params**
+> test_body_with_query_params(query, user)
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ query = 'query_example' # str |
+ user = petstore_api.User() # User |
+
+ try:
+ await api_instance.test_body_with_query_params(query, user)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **query** | **str**| |
+ **user** | [**User**](User.md)| |
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_client_model**
+> Client test_client_model(client)
+
+To test \"client\" model
+
+To test \"client\" model
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ client = petstore_api.Client() # Client | client model
+
+ try:
+ # To test \"client\" model
+ api_response = await api_instance.test_client_model(client)
+ print("The response of FakeApi->test_client_model:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_client_model: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **client** | [**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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_endpoint_parameters**
+> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, var_date=var_date, date_time=date_time, password=password, param_callback=param_callback)
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+### Example
+
+* Basic Authentication (http_basic_test):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: http_basic_test
+configuration = petstore_api.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ number = 3.4 # float | None
+ double = 3.4 # float | None
+ pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None
+ byte = 'byte_example' # str | None
+ integer = 56 # int | None (optional)
+ int32 = 56 # int | None (optional)
+ int64 = 56 # int | None (optional)
+ float = 3.4 # float | None (optional)
+ string = 'string_example' # str | None (optional)
+ binary = 'binary_example' # str | None (optional)
+ var_date = '2013-10-20' # date | None (optional)
+ date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional)
+ password = 'password_example' # str | None (optional)
+ param_callback = 'param_callback_example' # str | None (optional)
+
+ try:
+ # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ await api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, var_date=var_date, date_time=date_time, password=password, param_callback=param_callback)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **number** | **float**| None |
+ **double** | **float**| None |
+ **pattern_without_delimiter** | **str**| None |
+ **byte** | **str**| None |
+ **integer** | **int**| None | [optional]
+ **int32** | **int**| None | [optional]
+ **int64** | **int**| None | [optional]
+ **float** | **float**| None | [optional]
+ **string** | **str**| None | [optional]
+ **binary** | **str**| None | [optional]
+ **var_date** | **date**| None | [optional]
+ **date_time** | **datetime**| None | [optional]
+ **password** | **str**| None | [optional]
+ **param_callback** | **str**| None | [optional]
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_group_parameters**
+> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
+
+Fake endpoint to test group parameters (optional)
+
+Fake endpoint to test group parameters (optional)
+
+### Example
+
+* Bearer (JWT) Authentication (bearer_test):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure Bearer authorization (JWT): bearer_test
+configuration = petstore_api.Configuration(
+ access_token = os.environ["BEARER_TOKEN"]
+)
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ required_string_group = 56 # int | Required String in group parameters
+ required_boolean_group = True # bool | Required Boolean in group parameters
+ required_int64_group = 56 # int | Required Integer in group parameters
+ string_group = 56 # int | String in group parameters (optional)
+ boolean_group = True # bool | Boolean in group parameters (optional)
+ int64_group = 56 # int | Integer in group parameters (optional)
+
+ try:
+ # Fake endpoint to test group parameters (optional)
+ await api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **required_string_group** | **int**| Required String in group parameters |
+ **required_boolean_group** | **bool**| Required Boolean in group parameters |
+ **required_int64_group** | **int**| Required Integer in group parameters |
+ **string_group** | **int**| String in group parameters | [optional]
+ **boolean_group** | **bool**| Boolean in group parameters | [optional]
+ **int64_group** | **int**| Integer in group parameters | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[bearer_test](../README.md#bearer_test)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**400** | Someting wrong | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_inline_additional_properties**
+> test_inline_additional_properties(request_body)
+
+test inline additionalProperties
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ request_body = {'key': 'request_body_example'} # Dict[str, str] | request body
+
+ try:
+ # test inline additionalProperties
+ await api_instance.test_inline_additional_properties(request_body)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **request_body** | [**Dict[str, str]**](str.md)| request body |
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_json_form_data**
+> test_json_form_data(param, param2)
+
+test json serialization of form data
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ param = 'param_example' # str | field1
+ param2 = 'param2_example' # str | field2
+
+ try:
+ # test json serialization of form data
+ await api_instance.test_json_form_data(param, param2)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_json_form_data: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **param** | **str**| field1 |
+ **param2** | **str**| field2 |
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_query_parameter_collection_format**
+> test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language=language)
+
+
+
+To test the collection format in query parameters
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ pipe = ['pipe_example'] # List[str] |
+ ioutil = ['ioutil_example'] # List[str] |
+ http = ['http_example'] # List[str] |
+ url = ['url_example'] # List[str] |
+ context = ['context_example'] # List[str] |
+ allow_empty = 'allow_empty_example' # str |
+ language = {'key': 'language_example'} # Dict[str, str] | (optional)
+
+ try:
+ await api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language=language)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pipe** | [**List[str]**](str.md)| |
+ **ioutil** | [**List[str]**](str.md)| |
+ **http** | [**List[str]**](str.md)| |
+ **url** | [**List[str]**](str.md)| |
+ **context** | [**List[str]**](str.md)| |
+ **allow_empty** | **str**| |
+ **language** | [**Dict[str, str]**](str.md)| | [optional]
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeClassnameTags123Api.md
new file mode 100644
index 00000000000..180bad514ec
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeClassnameTags123Api.md
@@ -0,0 +1,84 @@
+# petstore_api.FakeClassnameTags123Api
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case
+
+
+# **test_classname**
+> Client test_classname(client)
+
+To test class name in snake case
+
+To test class name in snake case
+
+### Example
+
+* Api Key Authentication (api_key_query):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure API key authorization: api_key_query
+configuration.api_key['api_key_query'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['api_key_query'] = 'Bearer'
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeClassnameTags123Api(api_client)
+ client = petstore_api.Client() # Client | client model
+
+ try:
+ # To test class name in snake case
+ api_response = await api_instance.test_classname(client)
+ print("The response of FakeClassnameTags123Api->test_classname:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **client** | [**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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/File.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/File.md
new file mode 100644
index 00000000000..586da8e3255
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/File.md
@@ -0,0 +1,29 @@
+# File
+
+Must be named `File` for test.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**source_uri** | **str** | Test capitalization | [optional]
+
+## Example
+
+```python
+from petstore_api.models.file import File
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of File from a JSON string
+file_instance = File.from_json(json)
+# print the JSON string representation of the object
+print File.to_json()
+
+# convert the object into a dict
+file_dict = file_instance.to_dict()
+# create an instance of File from a dict
+file_form_dict = file.from_dict(file_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FileSchemaTestClass.md
new file mode 100644
index 00000000000..fb967a8d992
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FileSchemaTestClass.md
@@ -0,0 +1,29 @@
+# FileSchemaTestClass
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**file** | [**File**](File.md) | | [optional]
+**files** | [**List[File]**](File.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of FileSchemaTestClass from a JSON string
+file_schema_test_class_instance = FileSchemaTestClass.from_json(json)
+# print the JSON string representation of the object
+print FileSchemaTestClass.to_json()
+
+# convert the object into a dict
+file_schema_test_class_dict = file_schema_test_class_instance.to_dict()
+# create an instance of FileSchemaTestClass from a dict
+file_schema_test_class_form_dict = file_schema_test_class.from_dict(file_schema_test_class_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Foo.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Foo.md
new file mode 100644
index 00000000000..8062d08df1d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Foo.md
@@ -0,0 +1,28 @@
+# Foo
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **str** | | [optional] [default to 'bar']
+
+## Example
+
+```python
+from petstore_api.models.foo import Foo
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Foo from a JSON string
+foo_instance = Foo.from_json(json)
+# print the JSON string representation of the object
+print Foo.to_json()
+
+# convert the object into a dict
+foo_dict = foo_instance.to_dict()
+# create an instance of Foo from a dict
+foo_form_dict = foo.from_dict(foo_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FooGetDefaultResponse.md
new file mode 100644
index 00000000000..550fbe78fa1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FooGetDefaultResponse.md
@@ -0,0 +1,28 @@
+# FooGetDefaultResponse
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**string** | [**Foo**](Foo.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of FooGetDefaultResponse from a JSON string
+foo_get_default_response_instance = FooGetDefaultResponse.from_json(json)
+# print the JSON string representation of the object
+print FooGetDefaultResponse.to_json()
+
+# convert the object into a dict
+foo_get_default_response_dict = foo_get_default_response_instance.to_dict()
+# create an instance of FooGetDefaultResponse from a dict
+foo_get_default_response_form_dict = foo_get_default_response.from_dict(foo_get_default_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FormatTest.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FormatTest.md
new file mode 100644
index 00000000000..e42fa1ea019
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FormatTest.md
@@ -0,0 +1,43 @@
+# FormatTest
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**integer** | **int** | | [optional]
+**int32** | **int** | | [optional]
+**int64** | **int** | | [optional]
+**number** | **float** | |
+**float** | **float** | | [optional]
+**double** | **float** | | [optional]
+**decimal** | **decimal.Decimal** | | [optional]
+**string** | **str** | | [optional]
+**byte** | **str** | |
+**binary** | **str** | | [optional]
+**var_date** | **date** | |
+**date_time** | **datetime** | | [optional]
+**uuid** | **str** | | [optional]
+**password** | **str** | |
+**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional]
+**pattern_with_digits_and_delimiter** | **str** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
+
+## Example
+
+```python
+from petstore_api.models.format_test import FormatTest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of FormatTest from a JSON string
+format_test_instance = FormatTest.from_json(json)
+# print the JSON string representation of the object
+print FormatTest.to_json()
+
+# convert the object into a dict
+format_test_dict = format_test_instance.to_dict()
+# create an instance of FormatTest from a dict
+format_test_form_dict = format_test.from_dict(format_test_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/HasOnlyReadOnly.md
new file mode 100644
index 00000000000..99573bd28a2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/HasOnlyReadOnly.md
@@ -0,0 +1,29 @@
+# HasOnlyReadOnly
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **str** | | [optional] [readonly]
+**foo** | **str** | | [optional] [readonly]
+
+## Example
+
+```python
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of HasOnlyReadOnly from a JSON string
+has_only_read_only_instance = HasOnlyReadOnly.from_json(json)
+# print the JSON string representation of the object
+print HasOnlyReadOnly.to_json()
+
+# convert the object into a dict
+has_only_read_only_dict = has_only_read_only_instance.to_dict()
+# create an instance of HasOnlyReadOnly from a dict
+has_only_read_only_form_dict = has_only_read_only.from_dict(has_only_read_only_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/HealthCheckResult.md
new file mode 100644
index 00000000000..b8723e018aa
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/HealthCheckResult.md
@@ -0,0 +1,29 @@
+# HealthCheckResult
+
+Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**nullable_message** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.health_check_result import HealthCheckResult
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of HealthCheckResult from a JSON string
+health_check_result_instance = HealthCheckResult.from_json(json)
+# print the JSON string representation of the object
+print HealthCheckResult.to_json()
+
+# convert the object into a dict
+health_check_result_dict = health_check_result_instance.to_dict()
+# create an instance of HealthCheckResult from a dict
+health_check_result_form_dict = health_check_result.from_dict(health_check_result_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/List.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/List.md
new file mode 100644
index 00000000000..7643e4ea92d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/List.md
@@ -0,0 +1,28 @@
+# List
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**var_123_list** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.list import List
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of List from a JSON string
+list_instance = List.from_json(json)
+# print the JSON string representation of the object
+print List.to_json()
+
+# convert the object into a dict
+list_dict = list_instance.to_dict()
+# create an instance of List from a dict
+list_form_dict = list.from_dict(list_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/MapTest.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/MapTest.md
new file mode 100644
index 00000000000..ba87758a522
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/MapTest.md
@@ -0,0 +1,31 @@
+# MapTest
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**map_map_of_string** | **Dict[str, Dict[str, str]]** | | [optional]
+**map_of_enum_string** | **Dict[str, str]** | | [optional]
+**direct_map** | **Dict[str, bool]** | | [optional]
+**indirect_map** | **Dict[str, bool]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.map_test import MapTest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MapTest from a JSON string
+map_test_instance = MapTest.from_json(json)
+# print the JSON string representation of the object
+print MapTest.to_json()
+
+# convert the object into a dict
+map_test_dict = map_test_instance.to_dict()
+# create an instance of MapTest from a dict
+map_test_form_dict = map_test.from_dict(map_test_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/MixedPropertiesAndAdditionalPropertiesClass.md
new file mode 100644
index 00000000000..8f628d133ab
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -0,0 +1,30 @@
+# MixedPropertiesAndAdditionalPropertiesClass
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uuid** | **str** | | [optional]
+**date_time** | **datetime** | | [optional]
+**map** | [**Dict[str, Animal]**](Animal.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MixedPropertiesAndAdditionalPropertiesClass from a JSON string
+mixed_properties_and_additional_properties_class_instance = MixedPropertiesAndAdditionalPropertiesClass.from_json(json)
+# print the JSON string representation of the object
+print MixedPropertiesAndAdditionalPropertiesClass.to_json()
+
+# convert the object into a dict
+mixed_properties_and_additional_properties_class_dict = mixed_properties_and_additional_properties_class_instance.to_dict()
+# create an instance of MixedPropertiesAndAdditionalPropertiesClass from a dict
+mixed_properties_and_additional_properties_class_form_dict = mixed_properties_and_additional_properties_class.from_dict(mixed_properties_and_additional_properties_class_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Model200Response.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Model200Response.md
new file mode 100644
index 00000000000..6a20cefe99c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Model200Response.md
@@ -0,0 +1,30 @@
+# Model200Response
+
+Model for testing model name starting with number
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **int** | | [optional]
+**var_class** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.model200_response import Model200Response
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Model200Response from a JSON string
+model200_response_instance = Model200Response.from_json(json)
+# print the JSON string representation of the object
+print Model200Response.to_json()
+
+# convert the object into a dict
+model200_response_dict = model200_response_instance.to_dict()
+# create an instance of Model200Response from a dict
+model200_response_form_dict = model200_response.from_dict(model200_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ModelReturn.md
new file mode 100644
index 00000000000..a5b47f423c8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ModelReturn.md
@@ -0,0 +1,29 @@
+# ModelReturn
+
+Model for testing reserved words
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**var_return** | **int** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.model_return import ModelReturn
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ModelReturn from a JSON string
+model_return_instance = ModelReturn.from_json(json)
+# print the JSON string representation of the object
+print ModelReturn.to_json()
+
+# convert the object into a dict
+model_return_dict = model_return_instance.to_dict()
+# create an instance of ModelReturn from a dict
+model_return_form_dict = model_return.from_dict(model_return_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Name.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Name.md
new file mode 100644
index 00000000000..4ccd0ce09aa
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Name.md
@@ -0,0 +1,32 @@
+# Name
+
+Model for testing model name same as property name
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **int** | |
+**snake_case** | **int** | | [optional] [readonly]
+**var_property** | **str** | | [optional]
+**var_123_number** | **int** | | [optional] [readonly]
+
+## Example
+
+```python
+from petstore_api.models.name import Name
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Name from a JSON string
+name_instance = Name.from_json(json)
+# print the JSON string representation of the object
+print Name.to_json()
+
+# convert the object into a dict
+name_dict = name_instance.to_dict()
+# create an instance of Name from a dict
+name_form_dict = name.from_dict(name_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/NullableClass.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/NullableClass.md
new file mode 100644
index 00000000000..1658756b50e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/NullableClass.md
@@ -0,0 +1,40 @@
+# NullableClass
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**required_integer_prop** | **int** | |
+**integer_prop** | **int** | | [optional]
+**number_prop** | **float** | | [optional]
+**boolean_prop** | **bool** | | [optional]
+**string_prop** | **str** | | [optional]
+**date_prop** | **date** | | [optional]
+**datetime_prop** | **datetime** | | [optional]
+**array_nullable_prop** | **List[object]** | | [optional]
+**array_and_items_nullable_prop** | **List[object]** | | [optional]
+**array_items_nullable** | **List[object]** | | [optional]
+**object_nullable_prop** | **Dict[str, object]** | | [optional]
+**object_and_items_nullable_prop** | **Dict[str, object]** | | [optional]
+**object_items_nullable** | **Dict[str, object]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.nullable_class import NullableClass
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of NullableClass from a JSON string
+nullable_class_instance = NullableClass.from_json(json)
+# print the JSON string representation of the object
+print NullableClass.to_json()
+
+# convert the object into a dict
+nullable_class_dict = nullable_class_instance.to_dict()
+# create an instance of NullableClass from a dict
+nullable_class_form_dict = nullable_class.from_dict(nullable_class_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/NumberOnly.md
new file mode 100644
index 00000000000..f49216ddaa4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/NumberOnly.md
@@ -0,0 +1,28 @@
+# NumberOnly
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**just_number** | **float** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.number_only import NumberOnly
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of NumberOnly from a JSON string
+number_only_instance = NumberOnly.from_json(json)
+# print the JSON string representation of the object
+print NumberOnly.to_json()
+
+# convert the object into a dict
+number_only_dict = number_only_instance.to_dict()
+# create an instance of NumberOnly from a dict
+number_only_form_dict = number_only.from_dict(number_only_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ObjectWithDeprecatedFields.md
new file mode 100644
index 00000000000..8daa55a3916
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ObjectWithDeprecatedFields.md
@@ -0,0 +1,31 @@
+# ObjectWithDeprecatedFields
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uuid** | **str** | | [optional]
+**id** | **float** | | [optional]
+**deprecated_ref** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional]
+**bars** | **List[str]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ObjectWithDeprecatedFields from a JSON string
+object_with_deprecated_fields_instance = ObjectWithDeprecatedFields.from_json(json)
+# print the JSON string representation of the object
+print ObjectWithDeprecatedFields.to_json()
+
+# convert the object into a dict
+object_with_deprecated_fields_dict = object_with_deprecated_fields_instance.to_dict()
+# create an instance of ObjectWithDeprecatedFields from a dict
+object_with_deprecated_fields_form_dict = object_with_deprecated_fields.from_dict(object_with_deprecated_fields_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Order.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Order.md
new file mode 100644
index 00000000000..e71e955a11d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Order.md
@@ -0,0 +1,33 @@
+# Order
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**pet_id** | **int** | | [optional]
+**quantity** | **int** | | [optional]
+**ship_date** | **datetime** | | [optional]
+**status** | **str** | Order Status | [optional]
+**complete** | **bool** | | [optional] [default to False]
+
+## Example
+
+```python
+from petstore_api.models.order import Order
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Order from a JSON string
+order_instance = Order.from_json(json)
+# print the JSON string representation of the object
+print Order.to_json()
+
+# convert the object into a dict
+order_dict = order_instance.to_dict()
+# create an instance of Order from a dict
+order_form_dict = order.from_dict(order_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterComposite.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterComposite.md
new file mode 100644
index 00000000000..504e266f9a1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterComposite.md
@@ -0,0 +1,30 @@
+# OuterComposite
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**my_number** | **float** | | [optional]
+**my_string** | **str** | | [optional]
+**my_boolean** | **bool** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.outer_composite import OuterComposite
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of OuterComposite from a JSON string
+outer_composite_instance = OuterComposite.from_json(json)
+# print the JSON string representation of the object
+print OuterComposite.to_json()
+
+# convert the object into a dict
+outer_composite_dict = outer_composite_instance.to_dict()
+# create an instance of OuterComposite from a dict
+outer_composite_form_dict = outer_composite.from_dict(outer_composite_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterEnum.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterEnum.md
new file mode 100644
index 00000000000..4cb31437c7e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterEnum.md
@@ -0,0 +1,10 @@
+# OuterEnum
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterEnumDefaultValue.md
new file mode 100644
index 00000000000..4a5ba6428d8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterEnumDefaultValue.md
@@ -0,0 +1,10 @@
+# OuterEnumDefaultValue
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterEnumInteger.md
new file mode 100644
index 00000000000..fc84ec36585
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterEnumInteger.md
@@ -0,0 +1,10 @@
+# OuterEnumInteger
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterEnumIntegerDefaultValue.md
new file mode 100644
index 00000000000..0de4199a840
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterEnumIntegerDefaultValue.md
@@ -0,0 +1,10 @@
+# OuterEnumIntegerDefaultValue
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterObjectWithEnumProperty.md
new file mode 100644
index 00000000000..c6a1cdcbc19
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/OuterObjectWithEnumProperty.md
@@ -0,0 +1,29 @@
+# OuterObjectWithEnumProperty
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**str_value** | [**OuterEnum**](OuterEnum.md) | | [optional]
+**value** | [**OuterEnumInteger**](OuterEnumInteger.md) | |
+
+## Example
+
+```python
+from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of OuterObjectWithEnumProperty from a JSON string
+outer_object_with_enum_property_instance = OuterObjectWithEnumProperty.from_json(json)
+# print the JSON string representation of the object
+print OuterObjectWithEnumProperty.to_json()
+
+# convert the object into a dict
+outer_object_with_enum_property_dict = outer_object_with_enum_property_instance.to_dict()
+# create an instance of OuterObjectWithEnumProperty from a dict
+outer_object_with_enum_property_form_dict = outer_object_with_enum_property.from_dict(outer_object_with_enum_property_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Pet.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Pet.md
new file mode 100644
index 00000000000..05a466f880a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Pet.md
@@ -0,0 +1,33 @@
+# Pet
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**category** | [**Category**](Category.md) | | [optional]
+**name** | **str** | |
+**photo_urls** | **List[str]** | |
+**tags** | [**List[Tag]**](Tag.md) | | [optional]
+**status** | **str** | pet status in the store | [optional]
+
+## Example
+
+```python
+from petstore_api.models.pet import Pet
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Pet from a JSON string
+pet_instance = Pet.from_json(json)
+# print the JSON string representation of the object
+print Pet.to_json()
+
+# convert the object into a dict
+pet_dict = pet_instance.to_dict()
+# create an instance of Pet from a dict
+pet_form_dict = pet.from_dict(pet_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/PetApi.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/PetApi.md
new file mode 100644
index 00000000000..210934aa009
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/PetApi.md
@@ -0,0 +1,1292 @@
+# petstore_api.PetApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
+[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
+[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
+[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
+[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
+[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
+[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
+[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
+[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+
+
+# **add_pet**
+> add_pet(pet)
+
+Add a new pet to the store
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+
+ try:
+ # Add a new pet to the store
+ await api_instance.add_pet(pet)
+ except Exception as e:
+ print("Exception when calling PetApi->add_pet: %s\n" % e)
+```
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+
+ try:
+ # Add a new pet to the store
+ await api_instance.add_pet(pet)
+ except Exception as e:
+ print("Exception when calling PetApi->add_pet: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test), [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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **delete_pet**
+> delete_pet(pet_id, api_key=api_key)
+
+Deletes a pet
+
+
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | Pet id to delete
+ api_key = 'api_key_example' # str | (optional)
+
+ try:
+ # Deletes a pet
+ await api_instance.delete_pet(pet_id, api_key=api_key)
+ except Exception as e:
+ print("Exception when calling PetApi->delete_pet: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| Pet id to delete |
+ **api_key** | **str**| | [optional]
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **find_pets_by_status**
+> List[Pet] find_pets_by_status(status)
+
+Finds Pets by status
+
+Multiple status values can be provided with comma separated strings
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ status = ['status_example'] # List[str] | Status values that need to be considered for filter
+
+ try:
+ # Finds Pets by status
+ api_response = await api_instance.find_pets_by_status(status)
+ print("The response of PetApi->find_pets_by_status:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->find_pets_by_status: %s\n" % e)
+```
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ status = ['status_example'] # List[str] | Status values that need to be considered for filter
+
+ try:
+ # Finds Pets by status
+ api_response = await api_instance.find_pets_by_status(status)
+ print("The response of PetApi->find_pets_by_status:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->find_pets_by_status: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | [**List[str]**](str.md)| Status values that need to be considered for filter |
+
+### Return type
+
+[**List[Pet]**](Pet.md)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test), [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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **find_pets_by_tags**
+> List[Pet] find_pets_by_tags(tags)
+
+Finds Pets by tags
+
+Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ tags = ['tags_example'] # List[str] | Tags to filter by
+
+ try:
+ # Finds Pets by tags
+ api_response = await api_instance.find_pets_by_tags(tags)
+ print("The response of PetApi->find_pets_by_tags:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e)
+```
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ tags = ['tags_example'] # List[str] | Tags to filter by
+
+ try:
+ # Finds Pets by tags
+ api_response = await api_instance.find_pets_by_tags(tags)
+ print("The response of PetApi->find_pets_by_tags:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **tags** | [**List[str]**](str.md)| Tags to filter by |
+
+### Return type
+
+[**List[Pet]**](Pet.md)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test), [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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_pet_by_id**
+> Pet get_pet_by_id(pet_id)
+
+Find pet by ID
+
+Returns a single pet
+
+### Example
+
+* Api Key Authentication (api_key):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure API key authorization: api_key
+configuration.api_key['api_key'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['api_key'] = 'Bearer'
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet to return
+
+ try:
+ # Find pet by ID
+ api_response = await api_instance.get_pet_by_id(pet_id)
+ print("The response of PetApi->get_pet_by_id:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->get_pet_by_id: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| 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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **update_pet**
+> update_pet(pet)
+
+Update an existing pet
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+
+ try:
+ # Update an existing pet
+ await api_instance.update_pet(pet)
+ except Exception as e:
+ print("Exception when calling PetApi->update_pet: %s\n" % e)
+```
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+
+ try:
+ # Update an existing pet
+ await api_instance.update_pet(pet)
+ except Exception as e:
+ print("Exception when calling PetApi->update_pet: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test), [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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **update_pet_with_form**
+> update_pet_with_form(pet_id, name=name, status=status)
+
+Updates a pet in the store with form data
+
+
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet that needs to be updated
+ name = 'name_example' # str | Updated name of the pet (optional)
+ status = 'status_example' # str | Updated status of the pet (optional)
+
+ try:
+ # Updates a pet in the store with form data
+ await api_instance.update_pet_with_form(pet_id, name=name, status=status)
+ except Exception as e:
+ print("Exception when calling PetApi->update_pet_with_form: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| ID of pet that needs to be updated |
+ **name** | **str**| Updated name of the pet | [optional]
+ **status** | **str**| Updated status of the pet | [optional]
+
+### Return type
+
+void (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 |
+|-------------|-------------|------------------|
+**200** | Successful operation | - |
+**405** | Invalid input | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **upload_file**
+> ApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file)
+
+uploads an image
+
+
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet to update
+ additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
+ file = 'file_example' # str | file to upload (optional)
+
+ try:
+ # uploads an image
+ api_response = await api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file)
+ print("The response of PetApi->upload_file:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->upload_file: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| ID of pet to update |
+ **additional_metadata** | **str**| Additional data to pass to server | [optional]
+ **file** | **str**| file to upload | [optional]
+
+### Return type
+
+[**ApiResponse**](ApiResponse.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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **upload_file_with_required_file**
+> ApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
+
+uploads an image (required)
+
+
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet to update
+ required_file = 'required_file_example' # str | file to upload
+ additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
+
+ try:
+ # uploads an image (required)
+ api_response = await api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
+ print("The response of PetApi->upload_file_with_required_file:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| ID of pet to update |
+ **required_file** | **str**| file to upload |
+ **additional_metadata** | **str**| Additional data to pass to server | [optional]
+
+### Return type
+
+[**ApiResponse**](ApiResponse.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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Pig.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Pig.md
new file mode 100644
index 00000000000..398d6c6c6e3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Pig.md
@@ -0,0 +1,30 @@
+# Pig
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
+**color** | **str** | |
+**size** | **int** | |
+
+## Example
+
+```python
+from petstore_api.models.pig import Pig
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Pig from a JSON string
+pig_instance = Pig.from_json(json)
+# print the JSON string representation of the object
+print Pig.to_json()
+
+# convert the object into a dict
+pig_dict = pig_instance.to_dict()
+# create an instance of Pig from a dict
+pig_form_dict = pig.from_dict(pig_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ReadOnlyFirst.md
new file mode 100644
index 00000000000..22b5acca70c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ReadOnlyFirst.md
@@ -0,0 +1,29 @@
+# ReadOnlyFirst
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **str** | | [optional] [readonly]
+**baz** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.read_only_first import ReadOnlyFirst
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ReadOnlyFirst from a JSON string
+read_only_first_instance = ReadOnlyFirst.from_json(json)
+# print the JSON string representation of the object
+print ReadOnlyFirst.to_json()
+
+# convert the object into a dict
+read_only_first_dict = read_only_first_instance.to_dict()
+# create an instance of ReadOnlyFirst from a dict
+read_only_first_form_dict = read_only_first.from_dict(read_only_first_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/SelfReferenceModel.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/SelfReferenceModel.md
new file mode 100644
index 00000000000..dbf9589d576
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/SelfReferenceModel.md
@@ -0,0 +1,29 @@
+# SelfReferenceModel
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**size** | **int** | | [optional]
+**nested** | [**DummyModel**](DummyModel.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.self_reference_model import SelfReferenceModel
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of SelfReferenceModel from a JSON string
+self_reference_model_instance = SelfReferenceModel.from_json(json)
+# print the JSON string representation of the object
+print SelfReferenceModel.to_json()
+
+# convert the object into a dict
+self_reference_model_dict = self_reference_model_instance.to_dict()
+# create an instance of SelfReferenceModel from a dict
+self_reference_model_form_dict = self_reference_model.from_dict(self_reference_model_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/SingleRefType.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/SingleRefType.md
new file mode 100644
index 00000000000..4178ac3b505
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/SingleRefType.md
@@ -0,0 +1,10 @@
+# SingleRefType
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/SpecialModelName.md
new file mode 100644
index 00000000000..3d27640abb0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/SpecialModelName.md
@@ -0,0 +1,28 @@
+# SpecialModelName
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**special_property_name** | **int** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.special_model_name import SpecialModelName
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of SpecialModelName from a JSON string
+special_model_name_instance = SpecialModelName.from_json(json)
+# print the JSON string representation of the object
+print SpecialModelName.to_json()
+
+# convert the object into a dict
+special_model_name_dict = special_model_name_instance.to_dict()
+# create an instance of SpecialModelName from a dict
+special_model_name_form_dict = special_model_name.from_dict(special_model_name_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/SpecialName.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/SpecialName.md
new file mode 100644
index 00000000000..0b412952597
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/SpecialName.md
@@ -0,0 +1,30 @@
+# SpecialName
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**var_property** | **int** | | [optional]
+**var_async** | [**Category**](Category.md) | | [optional]
+**var_schema** | **str** | pet status in the store | [optional]
+
+## Example
+
+```python
+from petstore_api.models.special_name import SpecialName
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of SpecialName from a JSON string
+special_name_instance = SpecialName.from_json(json)
+# print the JSON string representation of the object
+print SpecialName.to_json()
+
+# convert the object into a dict
+special_name_dict = special_name_instance.to_dict()
+# create an instance of SpecialName from a dict
+special_name_form_dict = special_name.from_dict(special_name_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/StoreApi.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/StoreApi.md
new file mode 100644
index 00000000000..32cfe8a8f14
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/StoreApi.md
@@ -0,0 +1,277 @@
+# petstore_api.StoreApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
+[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
+[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID
+[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
+
+
+# **delete_order**
+> delete_order(order_id)
+
+Delete purchase order by ID
+
+For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.StoreApi(api_client)
+ order_id = 'order_id_example' # str | ID of the order that needs to be deleted
+
+ try:
+ # Delete purchase order by ID
+ await api_instance.delete_order(order_id)
+ except Exception as e:
+ print("Exception when calling StoreApi->delete_order: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **order_id** | **str**| ID of the order that needs to be deleted |
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_inventory**
+> Dict[str, int] get_inventory()
+
+Returns pet inventories by status
+
+Returns a map of status codes to quantities
+
+### Example
+
+* Api Key Authentication (api_key):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure API key authorization: api_key
+configuration.api_key['api_key'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['api_key'] = 'Bearer'
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.StoreApi(api_client)
+
+ try:
+ # Returns pet inventories by status
+ api_response = await api_instance.get_inventory()
+ print("The response of StoreApi->get_inventory:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling StoreApi->get_inventory: %s\n" % e)
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+**Dict[str, int]**
+
+### 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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_order_by_id**
+> Order get_order_by_id(order_id)
+
+Find purchase order by ID
+
+For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.StoreApi(api_client)
+ order_id = 56 # int | ID of pet that needs to be fetched
+
+ try:
+ # Find purchase order by ID
+ api_response = await api_instance.get_order_by_id(order_id)
+ print("The response of StoreApi->get_order_by_id:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling StoreApi->get_order_by_id: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **order_id** | **int**| 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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **place_order**
+> Order place_order(order)
+
+Place an order for a pet
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.StoreApi(api_client)
+ order = petstore_api.Order() # Order | order placed for purchasing the pet
+
+ try:
+ # Place an order for a pet
+ api_response = await api_instance.place_order(order)
+ print("The response of StoreApi->place_order:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling StoreApi->place_order: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **order** | [**Order**](Order.md)| order placed for purchasing the pet |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid Order | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Tag.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Tag.md
new file mode 100644
index 00000000000..e680c68bedd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/Tag.md
@@ -0,0 +1,29 @@
+# Tag
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**name** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.tag import Tag
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Tag from a JSON string
+tag_instance = Tag.from_json(json)
+# print the JSON string representation of the object
+print Tag.to_json()
+
+# convert the object into a dict
+tag_dict = tag_instance.to_dict()
+# create an instance of Tag from a dict
+tag_form_dict = tag.from_dict(tag_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/User.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/User.md
new file mode 100644
index 00000000000..6d7c357ea86
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/User.md
@@ -0,0 +1,35 @@
+# User
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**username** | **str** | | [optional]
+**first_name** | **str** | | [optional]
+**last_name** | **str** | | [optional]
+**email** | **str** | | [optional]
+**password** | **str** | | [optional]
+**phone** | **str** | | [optional]
+**user_status** | **int** | User Status | [optional]
+
+## Example
+
+```python
+from petstore_api.models.user import User
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of User from a JSON string
+user_instance = User.from_json(json)
+# print the JSON string representation of the object
+print User.to_json()
+
+# convert the object into a dict
+user_dict = user_instance.to_dict()
+# create an instance of User from a dict
+user_form_dict = user.from_dict(user_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/UserApi.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/UserApi.md
new file mode 100644
index 00000000000..cd85a9ce5cc
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/UserApi.md
@@ -0,0 +1,521 @@
+# petstore_api.UserApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**create_user**](UserApi.md#create_user) | **POST** /user | Create user
+[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array
+[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array
+[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user
+[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name
+[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system
+[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session
+[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user
+
+
+# **create_user**
+> create_user(user)
+
+Create user
+
+This can only be done by the logged in user.
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ user = petstore_api.User() # User | Created user object
+
+ try:
+ # Create user
+ await api_instance.create_user(user)
+ except Exception as e:
+ print("Exception when calling UserApi->create_user: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**User**](User.md)| Created user object |
+
+### Return type
+
+void (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 |
+|-------------|-------------|------------------|
+**0** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **create_users_with_array_input**
+> create_users_with_array_input(user)
+
+Creates list of users with given input array
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ user = [petstore_api.User()] # List[User] | List of user object
+
+ try:
+ # Creates list of users with given input array
+ await api_instance.create_users_with_array_input(user)
+ except Exception as e:
+ print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**List[User]**](User.md)| List of user object |
+
+### Return type
+
+void (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 |
+|-------------|-------------|------------------|
+**0** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **create_users_with_list_input**
+> create_users_with_list_input(user)
+
+Creates list of users with given input array
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ user = [petstore_api.User()] # List[User] | List of user object
+
+ try:
+ # Creates list of users with given input array
+ await api_instance.create_users_with_list_input(user)
+ except Exception as e:
+ print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**List[User]**](User.md)| List of user object |
+
+### Return type
+
+void (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 |
+|-------------|-------------|------------------|
+**0** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **delete_user**
+> delete_user(username)
+
+Delete user
+
+This can only be done by the logged in user.
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | The name that needs to be deleted
+
+ try:
+ # Delete user
+ await api_instance.delete_user(username)
+ except Exception as e:
+ print("Exception when calling UserApi->delete_user: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **str**| The name that needs to be deleted |
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_user_by_name**
+> User get_user_by_name(username)
+
+Get user by user name
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing.
+
+ try:
+ # Get user by user name
+ api_response = await api_instance.get_user_by_name(username)
+ print("The response of UserApi->get_user_by_name:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling UserApi->get_user_by_name: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **str**| 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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **login_user**
+> str login_user(username, password)
+
+Logs user into the system
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | The user name for login
+ password = 'password_example' # str | The password for login in clear text
+
+ try:
+ # Logs user into the system
+ api_response = await api_instance.login_user(username, password)
+ print("The response of UserApi->login_user:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling UserApi->login_user: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **str**| The user name for login |
+ **password** | **str**| The password for login in clear text |
+
+### Return type
+
+**str**
+
+### 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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **logout_user**
+> logout_user()
+
+Logs out current logged in user session
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+
+ try:
+ # Logs out current logged in user session
+ await api_instance.logout_user()
+ except Exception as e:
+ print("Exception when calling UserApi->logout_user: %s\n" % e)
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **update_user**
+> update_user(username, user)
+
+Updated user
+
+This can only be done by the logged in user.
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+async with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | name that need to be deleted
+ user = petstore_api.User() # User | Updated user object
+
+ try:
+ # Updated user
+ await api_instance.update_user(username, user)
+ except Exception as e:
+ print("Exception when calling UserApi->update_user: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **str**| name that need to be deleted |
+ **user** | [**User**](User.md)| Updated user object |
+
+### Return type
+
+void (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 |
+|-------------|-------------|------------------|
+**400** | Invalid user supplied | - |
+**404** | User not found | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/WithNestedOneOf.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/WithNestedOneOf.md
new file mode 100644
index 00000000000..b6211ba9194
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/WithNestedOneOf.md
@@ -0,0 +1,29 @@
+# WithNestedOneOf
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**size** | **int** | | [optional]
+**nested_pig** | [**Pig**](Pig.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.with_nested_one_of import WithNestedOneOf
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of WithNestedOneOf from a JSON string
+with_nested_one_of_instance = WithNestedOneOf.from_json(json)
+# print the JSON string representation of the object
+print WithNestedOneOf.to_json()
+
+# convert the object into a dict
+with_nested_one_of_dict = with_nested_one_of_instance.to_dict()
+# create an instance of WithNestedOneOf from a dict
+with_nested_one_of_form_dict = with_nested_one_of.from_dict(with_nested_one_of_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/git_push.sh b/samples/openapi3/client/petstore/python-nextgen-aiohttp/git_push.sh
new file mode 100644
index 00000000000..f53a75d4fab
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/git_push.sh
@@ -0,0 +1,57 @@
+#!/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-petstore-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/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/__init__.py
new file mode 100644
index 00000000000..6bc4148a4e1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/__init__.py
@@ -0,0 +1,93 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+__version__ = "1.0.0"
+
+# import apis into sdk package
+from petstore_api.api.another_fake_api import AnotherFakeApi
+from petstore_api.api.default_api import DefaultApi
+from petstore_api.api.fake_api import FakeApi
+from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api
+from petstore_api.api.pet_api import PetApi
+from petstore_api.api.store_api import StoreApi
+from petstore_api.api.user_api import UserApi
+
+# import ApiClient
+from petstore_api.api_client import ApiClient
+from petstore_api.configuration import Configuration
+from petstore_api.exceptions import OpenApiException
+from petstore_api.exceptions import ApiTypeError
+from petstore_api.exceptions import ApiValueError
+from petstore_api.exceptions import ApiKeyError
+from petstore_api.exceptions import ApiAttributeError
+from petstore_api.exceptions import ApiException
+# import models into sdk package
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
+from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
+from petstore_api.models.animal import Animal
+from petstore_api.models.any_of_pig import AnyOfPig
+from petstore_api.models.api_response import ApiResponse
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
+from petstore_api.models.array_test import ArrayTest
+from petstore_api.models.basque_pig import BasquePig
+from petstore_api.models.capitalization import Capitalization
+from petstore_api.models.cat import Cat
+from petstore_api.models.cat_all_of import CatAllOf
+from petstore_api.models.category import Category
+from petstore_api.models.class_model import ClassModel
+from petstore_api.models.client import Client
+from petstore_api.models.danish_pig import DanishPig
+from petstore_api.models.deprecated_object import DeprecatedObject
+from petstore_api.models.dog import Dog
+from petstore_api.models.dog_all_of import DogAllOf
+from petstore_api.models.dummy_model import DummyModel
+from petstore_api.models.enum_arrays import EnumArrays
+from petstore_api.models.enum_class import EnumClass
+from petstore_api.models.enum_test import EnumTest
+from petstore_api.models.file import File
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+from petstore_api.models.foo import Foo
+from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
+from petstore_api.models.format_test import FormatTest
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly
+from petstore_api.models.health_check_result import HealthCheckResult
+from petstore_api.models.list import List
+from petstore_api.models.map_test import MapTest
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+from petstore_api.models.model200_response import Model200Response
+from petstore_api.models.model_return import ModelReturn
+from petstore_api.models.name import Name
+from petstore_api.models.nullable_class import NullableClass
+from petstore_api.models.number_only import NumberOnly
+from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields
+from petstore_api.models.order import Order
+from petstore_api.models.outer_composite import OuterComposite
+from petstore_api.models.outer_enum import OuterEnum
+from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue
+from petstore_api.models.outer_enum_integer import OuterEnumInteger
+from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
+from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
+from petstore_api.models.pet import Pet
+from petstore_api.models.pig import Pig
+from petstore_api.models.read_only_first import ReadOnlyFirst
+from petstore_api.models.self_reference_model import SelfReferenceModel
+from petstore_api.models.single_ref_type import SingleRefType
+from petstore_api.models.special_model_name import SpecialModelName
+from petstore_api.models.special_name import SpecialName
+from petstore_api.models.tag import Tag
+from petstore_api.models.user import User
+from petstore_api.models.with_nested_one_of import WithNestedOneOf
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/__init__.py
new file mode 100644
index 00000000000..bc45197c40f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/__init__.py
@@ -0,0 +1,12 @@
+from __future__ import absolute_import
+
+# flake8: noqa
+
+# import apis into api package
+from petstore_api.api.another_fake_api import AnotherFakeApi
+from petstore_api.api.default_api import DefaultApi
+from petstore_api.api.fake_api import FakeApi
+from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api
+from petstore_api.api.pet_api import PetApi
+from petstore_api.api.store_api import StoreApi
+from petstore_api.api.user_api import UserApi
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/another_fake_api.py
new file mode 100644
index 00000000000..c4a9c365912
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/another_fake_api.py
@@ -0,0 +1,191 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field
+
+from petstore_api.models.client import Client
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class AnotherFakeApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def call_123_test_special_tags(self, client : Annotated[Client, Field(..., description="client model")], **kwargs) -> Client: # noqa: E501
+ """To test special tags # noqa: E501
+
+ To test special tags and operation ID starting with number # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.call_123_test_special_tags(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Client
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.call_123_test_special_tags_with_http_info(client, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def call_123_test_special_tags_with_http_info(self, client : Annotated[Client, Field(..., description="client model")], **kwargs): # noqa: E501
+ """To test special tags # noqa: E501
+
+ To test special tags and operation ID starting with number # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.call_123_test_special_tags_with_http_info(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'client'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method call_123_test_special_tags" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['client']:
+ _body_params = _params['client']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "Client",
+ }
+
+ return self.api_client.call_api(
+ '/another-fake/dummy', 'PATCH',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/default_api.py
new file mode 100644
index 00000000000..b3e39a7303d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/default_api.py
@@ -0,0 +1,172 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class DefaultApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def foo_get(self, **kwargs) -> FooGetDefaultResponse: # noqa: E501
+ """foo_get # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.foo_get(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: FooGetDefaultResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.foo_get_with_http_info(**kwargs) # noqa: E501
+
+ @validate_arguments
+ def foo_get_with_http_info(self, **kwargs): # noqa: E501
+ """foo_get # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.foo_get_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(FooGetDefaultResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method foo_get" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ }
+
+ return self.api_client.call_api(
+ '/foo', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_api.py
new file mode 100644
index 00000000000..58bd69612b8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_api.py
@@ -0,0 +1,2564 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from datetime import date, datetime
+
+from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, confloat, conint, constr, validator
+
+from typing import Dict, List, Optional
+
+from petstore_api.models.client import Client
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+from petstore_api.models.health_check_result import HealthCheckResult
+from petstore_api.models.outer_composite import OuterComposite
+from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
+from petstore_api.models.pet import Pet
+from petstore_api.models.user import User
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class FakeApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def fake_health_get(self, **kwargs) -> HealthCheckResult: # noqa: E501
+ """Health check endpoint # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_health_get(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: HealthCheckResult
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_health_get_with_http_info(**kwargs) # noqa: E501
+
+ @validate_arguments
+ def fake_health_get_with_http_info(self, **kwargs): # noqa: E501
+ """Health check endpoint # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_health_get_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(HealthCheckResult, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_health_get" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "HealthCheckResult",
+ }
+
+ return self.api_client.call_api(
+ '/fake/health', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def fake_http_signature_test(self, pet : Annotated[Pet, Field(..., description="Pet object that needs to be added to the store")], query_1 : Annotated[Optional[StrictStr], Field(description="query parameter")] = None, header_1 : Annotated[Optional[StrictStr], Field(description="header parameter")] = None, **kwargs) -> None: # noqa: E501
+ """test http signature authentication # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_http_signature_test(pet, query_1, header_1, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param query_1: query parameter
+ :type query_1: str
+ :param header_1: header parameter
+ :type header_1: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_http_signature_test_with_http_info(pet, query_1, header_1, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def fake_http_signature_test_with_http_info(self, pet : Annotated[Pet, Field(..., description="Pet object that needs to be added to the store")], query_1 : Annotated[Optional[StrictStr], Field(description="query parameter")] = None, header_1 : Annotated[Optional[StrictStr], Field(description="header parameter")] = None, **kwargs): # noqa: E501
+ """test http signature authentication # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_http_signature_test_with_http_info(pet, query_1, header_1, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param query_1: query parameter
+ :type query_1: str
+ :param header_1: header parameter
+ :type header_1: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pet',
+ 'query_1',
+ 'header_1'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_http_signature_test" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('query_1') is not None: # noqa: E501
+ _query_params.append(('query_1', _params['query_1']))
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ if _params['header_1']:
+ _header_params['header_1'] = _params['header_1']
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['pet']:
+ _body_params = _params['pet']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json', 'application/xml']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['http_signature_test'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/http-signature-test', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def fake_outer_boolean_serialize(self, body : Annotated[Optional[StrictBool], Field(description="Input boolean as post body")] = None, **kwargs) -> bool: # noqa: E501
+ """fake_outer_boolean_serialize # noqa: E501
+
+ Test serialization of outer boolean types # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_outer_boolean_serialize(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input boolean as post body
+ :type body: bool
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: bool
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_outer_boolean_serialize_with_http_info(body, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def fake_outer_boolean_serialize_with_http_info(self, body : Annotated[Optional[StrictBool], Field(description="Input boolean as post body")] = None, **kwargs): # noqa: E501
+ """fake_outer_boolean_serialize # noqa: E501
+
+ Test serialization of outer boolean types # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_outer_boolean_serialize_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input boolean as post body
+ :type body: bool
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(bool, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'body'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_outer_boolean_serialize" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['body']:
+ _body_params = _params['body']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "bool",
+ }
+
+ return self.api_client.call_api(
+ '/fake/outer/boolean', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def fake_outer_composite_serialize(self, outer_composite : Annotated[Optional[OuterComposite], Field(description="Input composite as post body")] = None, **kwargs) -> OuterComposite: # noqa: E501
+ """fake_outer_composite_serialize # noqa: E501
+
+ Test serialization of object with outer number type # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_outer_composite_serialize(outer_composite, async_req=True)
+ >>> result = thread.get()
+
+ :param outer_composite: Input composite as post body
+ :type outer_composite: OuterComposite
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: OuterComposite
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_outer_composite_serialize_with_http_info(outer_composite, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def fake_outer_composite_serialize_with_http_info(self, outer_composite : Annotated[Optional[OuterComposite], Field(description="Input composite as post body")] = None, **kwargs): # noqa: E501
+ """fake_outer_composite_serialize # noqa: E501
+
+ Test serialization of object with outer number type # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_outer_composite_serialize_with_http_info(outer_composite, async_req=True)
+ >>> result = thread.get()
+
+ :param outer_composite: Input composite as post body
+ :type outer_composite: OuterComposite
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(OuterComposite, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'outer_composite'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_outer_composite_serialize" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['outer_composite']:
+ _body_params = _params['outer_composite']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "OuterComposite",
+ }
+
+ return self.api_client.call_api(
+ '/fake/outer/composite', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def fake_outer_number_serialize(self, body : Annotated[Optional[StrictFloat], Field(description="Input number as post body")] = None, **kwargs) -> float: # noqa: E501
+ """fake_outer_number_serialize # noqa: E501
+
+ Test serialization of outer number types # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_outer_number_serialize(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input number as post body
+ :type body: float
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: float
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_outer_number_serialize_with_http_info(body, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def fake_outer_number_serialize_with_http_info(self, body : Annotated[Optional[StrictFloat], Field(description="Input number as post body")] = None, **kwargs): # noqa: E501
+ """fake_outer_number_serialize # noqa: E501
+
+ Test serialization of outer number types # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_outer_number_serialize_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input number as post body
+ :type body: float
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(float, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'body'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_outer_number_serialize" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['body']:
+ _body_params = _params['body']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "float",
+ }
+
+ return self.api_client.call_api(
+ '/fake/outer/number', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def fake_outer_string_serialize(self, body : Annotated[Optional[StrictStr], Field(description="Input string as post body")] = None, **kwargs) -> str: # noqa: E501
+ """fake_outer_string_serialize # noqa: E501
+
+ Test serialization of outer string types # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_outer_string_serialize(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input string as post body
+ :type body: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: str
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_outer_string_serialize_with_http_info(body, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def fake_outer_string_serialize_with_http_info(self, body : Annotated[Optional[StrictStr], Field(description="Input string as post body")] = None, **kwargs): # noqa: E501
+ """fake_outer_string_serialize # noqa: E501
+
+ Test serialization of outer string types # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_outer_string_serialize_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input string as post body
+ :type body: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'body'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_outer_string_serialize" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['body']:
+ _body_params = _params['body']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "str",
+ }
+
+ return self.api_client.call_api(
+ '/fake/outer/string', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def fake_property_enum_integer_serialize(self, outer_object_with_enum_property : Annotated[OuterObjectWithEnumProperty, Field(..., description="Input enum (int) as post body")], **kwargs) -> OuterObjectWithEnumProperty: # noqa: E501
+ """fake_property_enum_integer_serialize # noqa: E501
+
+ Test serialization of enum (int) properties with examples # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_property_enum_integer_serialize(outer_object_with_enum_property, async_req=True)
+ >>> result = thread.get()
+
+ :param outer_object_with_enum_property: Input enum (int) as post body (required)
+ :type outer_object_with_enum_property: OuterObjectWithEnumProperty
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: OuterObjectWithEnumProperty
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_property_enum_integer_serialize_with_http_info(outer_object_with_enum_property, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def fake_property_enum_integer_serialize_with_http_info(self, outer_object_with_enum_property : Annotated[OuterObjectWithEnumProperty, Field(..., description="Input enum (int) as post body")], **kwargs): # noqa: E501
+ """fake_property_enum_integer_serialize # noqa: E501
+
+ Test serialization of enum (int) properties with examples # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_property_enum_integer_serialize_with_http_info(outer_object_with_enum_property, async_req=True)
+ >>> result = thread.get()
+
+ :param outer_object_with_enum_property: Input enum (int) as post body (required)
+ :type outer_object_with_enum_property: OuterObjectWithEnumProperty
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(OuterObjectWithEnumProperty, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'outer_object_with_enum_property'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_property_enum_integer_serialize" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['outer_object_with_enum_property']:
+ _body_params = _params['outer_object_with_enum_property']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "OuterObjectWithEnumProperty",
+ }
+
+ return self.api_client.call_api(
+ '/fake/property/enum-int', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_body_with_binary(self, body : Annotated[Optional[StrictStr], Field(..., description="image to upload")], **kwargs) -> None: # noqa: E501
+ """test_body_with_binary # noqa: E501
+
+ For this test, the body has to be a binary file. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_body_with_binary(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: image to upload (required)
+ :type body: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_body_with_binary_with_http_info(body, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_body_with_binary_with_http_info(self, body : Annotated[Optional[StrictStr], Field(..., description="image to upload")], **kwargs): # noqa: E501
+ """test_body_with_binary # noqa: E501
+
+ For this test, the body has to be a binary file. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_body_with_binary_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: image to upload (required)
+ :type body: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'body'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_body_with_binary" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['body']:
+ _body_params = _params['body']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['image/png']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/body-with-binary', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_body_with_file_schema(self, file_schema_test_class : FileSchemaTestClass, **kwargs) -> None: # noqa: E501
+ """test_body_with_file_schema # noqa: E501
+
+ For this test, the body for this request must reference a schema named `File`. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True)
+ >>> result = thread.get()
+
+ :param file_schema_test_class: (required)
+ :type file_schema_test_class: FileSchemaTestClass
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_body_with_file_schema_with_http_info(file_schema_test_class, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_body_with_file_schema_with_http_info(self, file_schema_test_class : FileSchemaTestClass, **kwargs): # noqa: E501
+ """test_body_with_file_schema # noqa: E501
+
+ For this test, the body for this request must reference a schema named `File`. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_body_with_file_schema_with_http_info(file_schema_test_class, async_req=True)
+ >>> result = thread.get()
+
+ :param file_schema_test_class: (required)
+ :type file_schema_test_class: FileSchemaTestClass
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'file_schema_test_class'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_body_with_file_schema" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['file_schema_test_class']:
+ _body_params = _params['file_schema_test_class']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/body-with-file-schema', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_body_with_query_params(self, query : StrictStr, user : User, **kwargs) -> None: # noqa: E501
+ """test_body_with_query_params # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_body_with_query_params(query, user, async_req=True)
+ >>> result = thread.get()
+
+ :param query: (required)
+ :type query: str
+ :param user: (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_body_with_query_params_with_http_info(query, user, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_body_with_query_params_with_http_info(self, query : StrictStr, user : User, **kwargs): # noqa: E501
+ """test_body_with_query_params # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_body_with_query_params_with_http_info(query, user, async_req=True)
+ >>> result = thread.get()
+
+ :param query: (required)
+ :type query: str
+ :param user: (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'query',
+ 'user'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_body_with_query_params" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('query') is not None: # noqa: E501
+ _query_params.append(('query', _params['query']))
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['user']:
+ _body_params = _params['user']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/body-with-query-params', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_client_model(self, client : Annotated[Client, Field(..., description="client model")], **kwargs) -> Client: # noqa: E501
+ """To test \"client\" model # noqa: E501
+
+ To test \"client\" model # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_client_model(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Client
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_client_model_with_http_info(client, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_client_model_with_http_info(self, client : Annotated[Client, Field(..., description="client model")], **kwargs): # noqa: E501
+ """To test \"client\" model # noqa: E501
+
+ To test \"client\" model # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_client_model_with_http_info(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'client'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_client_model" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['client']:
+ _body_params = _params['client']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "Client",
+ }
+
+ return self.api_client.call_api(
+ '/fake', 'PATCH',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_endpoint_parameters(self, number : Annotated[confloat(strict=True, ge=543.2, le=32.1), Field(..., description="None")], double : Annotated[confloat(strict=True, ge=123.4, le=67.8), Field(..., description="None")], pattern_without_delimiter : Annotated[constr(strict=True), Field(..., description="None")], byte : Annotated[StrictStr, Field(..., description="None")], integer : Annotated[Optional[conint(strict=True, ge=100, le=10)], Field(description="None")] = None, int32 : Annotated[Optional[conint(strict=True, ge=200, le=20)], Field(description="None")] = None, int64 : Annotated[Optional[StrictInt], Field(description="None")] = None, float : Annotated[Optional[confloat(strict=True, ge=987.6)], Field(description="None")] = None, string : Annotated[Optional[constr(strict=True)], Field(description="None")] = None, binary : Annotated[Optional[StrictStr], Field(description="None")] = None, var_date : Annotated[Optional[date], Field(description="None")] = None, date_time : Annotated[Optional[datetime], Field(description="None")] = None, password : Annotated[Optional[constr(strict=True, max_length=64, min_length=10)], Field(description="None")] = None, param_callback : Annotated[Optional[StrictStr], Field(description="None")] = None, **kwargs) -> None: # noqa: E501
+ """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+
+ Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, var_date, date_time, password, param_callback, async_req=True)
+ >>> result = thread.get()
+
+ :param number: None (required)
+ :type number: float
+ :param double: None (required)
+ :type double: float
+ :param pattern_without_delimiter: None (required)
+ :type pattern_without_delimiter: str
+ :param byte: None (required)
+ :type byte: str
+ :param integer: None
+ :type integer: int
+ :param int32: None
+ :type int32: int
+ :param int64: None
+ :type int64: int
+ :param float: None
+ :type float: float
+ :param string: None
+ :type string: str
+ :param binary: None
+ :type binary: str
+ :param var_date: None
+ :type var_date: date
+ :param date_time: None
+ :type date_time: datetime
+ :param password: None
+ :type password: str
+ :param param_callback: None
+ :type param_callback: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, var_date, date_time, password, param_callback, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_endpoint_parameters_with_http_info(self, number : Annotated[confloat(strict=True, ge=543.2, le=32.1), Field(..., description="None")], double : Annotated[confloat(strict=True, ge=123.4, le=67.8), Field(..., description="None")], pattern_without_delimiter : Annotated[constr(strict=True), Field(..., description="None")], byte : Annotated[StrictStr, Field(..., description="None")], integer : Annotated[Optional[conint(strict=True, ge=100, le=10)], Field(description="None")] = None, int32 : Annotated[Optional[conint(strict=True, ge=200, le=20)], Field(description="None")] = None, int64 : Annotated[Optional[StrictInt], Field(description="None")] = None, float : Annotated[Optional[confloat(strict=True, ge=987.6)], Field(description="None")] = None, string : Annotated[Optional[constr(strict=True)], Field(description="None")] = None, binary : Annotated[Optional[StrictStr], Field(description="None")] = None, var_date : Annotated[Optional[date], Field(description="None")] = None, date_time : Annotated[Optional[datetime], Field(description="None")] = None, password : Annotated[Optional[constr(strict=True, max_length=64, min_length=10)], Field(description="None")] = None, param_callback : Annotated[Optional[StrictStr], Field(description="None")] = None, **kwargs): # noqa: E501
+ """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+
+ Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, var_date, date_time, password, param_callback, async_req=True)
+ >>> result = thread.get()
+
+ :param number: None (required)
+ :type number: float
+ :param double: None (required)
+ :type double: float
+ :param pattern_without_delimiter: None (required)
+ :type pattern_without_delimiter: str
+ :param byte: None (required)
+ :type byte: str
+ :param integer: None
+ :type integer: int
+ :param int32: None
+ :type int32: int
+ :param int64: None
+ :type int64: int
+ :param float: None
+ :type float: float
+ :param string: None
+ :type string: str
+ :param binary: None
+ :type binary: str
+ :param var_date: None
+ :type var_date: date
+ :param date_time: None
+ :type date_time: datetime
+ :param password: None
+ :type password: str
+ :param param_callback: None
+ :type param_callback: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'number',
+ 'double',
+ 'pattern_without_delimiter',
+ 'byte',
+ 'integer',
+ 'int32',
+ 'int64',
+ 'float',
+ 'string',
+ 'binary',
+ 'var_date',
+ 'date_time',
+ 'password',
+ 'param_callback'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_endpoint_parameters" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ if _params['integer']:
+ _form_params.append(('integer', _params['integer']))
+ if _params['int32']:
+ _form_params.append(('int32', _params['int32']))
+ if _params['int64']:
+ _form_params.append(('int64', _params['int64']))
+ if _params['number']:
+ _form_params.append(('number', _params['number']))
+ if _params['float']:
+ _form_params.append(('float', _params['float']))
+ if _params['double']:
+ _form_params.append(('double', _params['double']))
+ if _params['string']:
+ _form_params.append(('string', _params['string']))
+ if _params['pattern_without_delimiter']:
+ _form_params.append(('pattern_without_delimiter', _params['pattern_without_delimiter']))
+ if _params['byte']:
+ _form_params.append(('byte', _params['byte']))
+ if _params['binary']:
+ _files['binary'] = _params['binary']
+ if _params['var_date']:
+ _form_params.append(('date', _params['var_date']))
+ if _params['date_time']:
+ _form_params.append(('dateTime', _params['date_time']))
+ if _params['password']:
+ _form_params.append(('password', _params['password']))
+ if _params['param_callback']:
+ _form_params.append(('callback', _params['param_callback']))
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/x-www-form-urlencoded']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['http_basic_test'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_group_parameters(self, required_string_group : Annotated[StrictInt, Field(..., description="Required String in group parameters")], required_boolean_group : Annotated[StrictBool, Field(..., description="Required Boolean in group parameters")], required_int64_group : Annotated[StrictInt, Field(..., description="Required Integer in group parameters")], string_group : Annotated[Optional[StrictInt], Field(description="String in group parameters")] = None, boolean_group : Annotated[Optional[StrictBool], Field(description="Boolean in group parameters")] = None, int64_group : Annotated[Optional[StrictInt], Field(description="Integer in group parameters")] = None, **kwargs) -> None: # noqa: E501
+ """Fake endpoint to test group parameters (optional) # noqa: E501
+
+ Fake endpoint to test group parameters (optional) # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group, boolean_group, int64_group, async_req=True)
+ >>> result = thread.get()
+
+ :param required_string_group: Required String in group parameters (required)
+ :type required_string_group: int
+ :param required_boolean_group: Required Boolean in group parameters (required)
+ :type required_boolean_group: bool
+ :param required_int64_group: Required Integer in group parameters (required)
+ :type required_int64_group: int
+ :param string_group: String in group parameters
+ :type string_group: int
+ :param boolean_group: Boolean in group parameters
+ :type boolean_group: bool
+ :param int64_group: Integer in group parameters
+ :type int64_group: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, string_group, boolean_group, int64_group, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_group_parameters_with_http_info(self, required_string_group : Annotated[StrictInt, Field(..., description="Required String in group parameters")], required_boolean_group : Annotated[StrictBool, Field(..., description="Required Boolean in group parameters")], required_int64_group : Annotated[StrictInt, Field(..., description="Required Integer in group parameters")], string_group : Annotated[Optional[StrictInt], Field(description="String in group parameters")] = None, boolean_group : Annotated[Optional[StrictBool], Field(description="Boolean in group parameters")] = None, int64_group : Annotated[Optional[StrictInt], Field(description="Integer in group parameters")] = None, **kwargs): # noqa: E501
+ """Fake endpoint to test group parameters (optional) # noqa: E501
+
+ Fake endpoint to test group parameters (optional) # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, string_group, boolean_group, int64_group, async_req=True)
+ >>> result = thread.get()
+
+ :param required_string_group: Required String in group parameters (required)
+ :type required_string_group: int
+ :param required_boolean_group: Required Boolean in group parameters (required)
+ :type required_boolean_group: bool
+ :param required_int64_group: Required Integer in group parameters (required)
+ :type required_int64_group: int
+ :param string_group: String in group parameters
+ :type string_group: int
+ :param boolean_group: Boolean in group parameters
+ :type boolean_group: bool
+ :param int64_group: Integer in group parameters
+ :type int64_group: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'required_string_group',
+ 'required_boolean_group',
+ 'required_int64_group',
+ 'string_group',
+ 'boolean_group',
+ 'int64_group'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_group_parameters" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('required_string_group') is not None: # noqa: E501
+ _query_params.append(('required_string_group', _params['required_string_group']))
+ if _params.get('required_int64_group') is not None: # noqa: E501
+ _query_params.append(('required_int64_group', _params['required_int64_group']))
+ if _params.get('string_group') is not None: # noqa: E501
+ _query_params.append(('string_group', _params['string_group']))
+ if _params.get('int64_group') is not None: # noqa: E501
+ _query_params.append(('int64_group', _params['int64_group']))
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ if _params['required_boolean_group']:
+ _header_params['required_boolean_group'] = _params['required_boolean_group']
+ if _params['boolean_group']:
+ _header_params['boolean_group'] = _params['boolean_group']
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # authentication setting
+ _auth_settings = ['bearer_test'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake', 'DELETE',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_inline_additional_properties(self, request_body : Annotated[Dict[str, StrictStr], Field(..., description="request body")], **kwargs) -> None: # noqa: E501
+ """test inline additionalProperties # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_inline_additional_properties(request_body, async_req=True)
+ >>> result = thread.get()
+
+ :param request_body: request body (required)
+ :type request_body: Dict[str, str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_inline_additional_properties_with_http_info(request_body, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_inline_additional_properties_with_http_info(self, request_body : Annotated[Dict[str, StrictStr], Field(..., description="request body")], **kwargs): # noqa: E501
+ """test inline additionalProperties # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_inline_additional_properties_with_http_info(request_body, async_req=True)
+ >>> result = thread.get()
+
+ :param request_body: request body (required)
+ :type request_body: Dict[str, str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'request_body'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_inline_additional_properties" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['request_body']:
+ _body_params = _params['request_body']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/inline-additionalProperties', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_json_form_data(self, param : Annotated[StrictStr, Field(..., description="field1")], param2 : Annotated[StrictStr, Field(..., description="field2")], **kwargs) -> None: # noqa: E501
+ """test json serialization of form data # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_json_form_data(param, param2, async_req=True)
+ >>> result = thread.get()
+
+ :param param: field1 (required)
+ :type param: str
+ :param param2: field2 (required)
+ :type param2: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_json_form_data_with_http_info(self, param : Annotated[StrictStr, Field(..., description="field1")], param2 : Annotated[StrictStr, Field(..., description="field2")], **kwargs): # noqa: E501
+ """test json serialization of form data # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True)
+ >>> result = thread.get()
+
+ :param param: field1 (required)
+ :type param: str
+ :param param2: field2 (required)
+ :type param2: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'param',
+ 'param2'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_json_form_data" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ if _params['param']:
+ _form_params.append(('param', _params['param']))
+ if _params['param2']:
+ _form_params.append(('param2', _params['param2']))
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/x-www-form-urlencoded']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/jsonFormData', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_query_parameter_collection_format(self, pipe : List[StrictStr], ioutil : List[StrictStr], http : List[StrictStr], url : List[StrictStr], context : List[StrictStr], allow_empty : StrictStr, language : Optional[Dict[str, StrictStr]] = None, **kwargs) -> None: # noqa: E501
+ """test_query_parameter_collection_format # noqa: E501
+
+ To test the collection format in query parameters # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language, async_req=True)
+ >>> result = thread.get()
+
+ :param pipe: (required)
+ :type pipe: List[str]
+ :param ioutil: (required)
+ :type ioutil: List[str]
+ :param http: (required)
+ :type http: List[str]
+ :param url: (required)
+ :type url: List[str]
+ :param context: (required)
+ :type context: List[str]
+ :param allow_empty: (required)
+ :type allow_empty: str
+ :param language:
+ :type language: Dict[str, str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, language, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_query_parameter_collection_format_with_http_info(self, pipe : List[StrictStr], ioutil : List[StrictStr], http : List[StrictStr], url : List[StrictStr], context : List[StrictStr], allow_empty : StrictStr, language : Optional[Dict[str, StrictStr]] = None, **kwargs): # noqa: E501
+ """test_query_parameter_collection_format # noqa: E501
+
+ To test the collection format in query parameters # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, language, async_req=True)
+ >>> result = thread.get()
+
+ :param pipe: (required)
+ :type pipe: List[str]
+ :param ioutil: (required)
+ :type ioutil: List[str]
+ :param http: (required)
+ :type http: List[str]
+ :param url: (required)
+ :type url: List[str]
+ :param context: (required)
+ :type context: List[str]
+ :param allow_empty: (required)
+ :type allow_empty: str
+ :param language:
+ :type language: Dict[str, str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pipe',
+ 'ioutil',
+ 'http',
+ 'url',
+ 'context',
+ 'allow_empty',
+ 'language'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_query_parameter_collection_format" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('pipe') is not None: # noqa: E501
+ _query_params.append(('pipe', _params['pipe']))
+ _collection_formats['pipe'] = 'pipes'
+ if _params.get('ioutil') is not None: # noqa: E501
+ _query_params.append(('ioutil', _params['ioutil']))
+ _collection_formats['ioutil'] = 'csv'
+ if _params.get('http') is not None: # noqa: E501
+ _query_params.append(('http', _params['http']))
+ _collection_formats['http'] = 'ssv'
+ if _params.get('url') is not None: # noqa: E501
+ _query_params.append(('url', _params['url']))
+ _collection_formats['url'] = 'csv'
+ if _params.get('context') is not None: # noqa: E501
+ _query_params.append(('context', _params['context']))
+ _collection_formats['context'] = 'multi'
+ if _params.get('language') is not None: # noqa: E501
+ _query_params.append(('language', _params['language']))
+ if _params.get('allow_empty') is not None: # noqa: E501
+ _query_params.append(('allowEmpty', _params['allow_empty']))
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/test-query-parameters', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_classname_tags123_api.py
new file mode 100644
index 00000000000..63abc97279f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_classname_tags123_api.py
@@ -0,0 +1,191 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field
+
+from petstore_api.models.client import Client
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class FakeClassnameTags123Api(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def test_classname(self, client : Annotated[Client, Field(..., description="client model")], **kwargs) -> Client: # noqa: E501
+ """To test class name in snake case # noqa: E501
+
+ To test class name in snake case # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_classname(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Client
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_classname_with_http_info(client, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_classname_with_http_info(self, client : Annotated[Client, Field(..., description="client model")], **kwargs): # noqa: E501
+ """To test class name in snake case # noqa: E501
+
+ To test class name in snake case # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_classname_with_http_info(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'client'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_classname" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['client']:
+ _body_params = _params['client']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['api_key_query'] # noqa: E501
+
+ _response_types_map = {
+ '200': "Client",
+ }
+
+ return self.api_client.call_api(
+ '/fake_classname_test', 'PATCH',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/pet_api.py
new file mode 100644
index 00000000000..06580cfe707
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/pet_api.py
@@ -0,0 +1,1397 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictInt, StrictStr, validator
+
+from typing import List, Optional
+
+from petstore_api.models.api_response import ApiResponse
+from petstore_api.models.pet import Pet
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class PetApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def add_pet(self, pet : Annotated[Pet, Field(..., description="Pet object that needs to be added to the store")], **kwargs) -> None: # noqa: E501
+ """Add a new pet to the store # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.add_pet(pet, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.add_pet_with_http_info(pet, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def add_pet_with_http_info(self, pet : Annotated[Pet, Field(..., description="Pet object that needs to be added to the store")], **kwargs): # noqa: E501
+ """Add a new pet to the store # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.add_pet_with_http_info(pet, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pet'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method add_pet" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['pet']:
+ _body_params = _params['pet']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json', 'application/xml']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['http_signature_test', 'petstore_auth'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/pet', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def delete_pet(self, pet_id : Annotated[StrictInt, Field(..., description="Pet id to delete")], api_key : Optional[StrictStr] = None, **kwargs) -> None: # noqa: E501
+ """Deletes a pet # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_pet(pet_id, api_key, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: Pet id to delete (required)
+ :type pet_id: int
+ :param api_key:
+ :type api_key: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.delete_pet_with_http_info(pet_id, api_key, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def delete_pet_with_http_info(self, pet_id : Annotated[StrictInt, Field(..., description="Pet id to delete")], api_key : Optional[StrictStr] = None, **kwargs): # noqa: E501
+ """Deletes a pet # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_pet_with_http_info(pet_id, api_key, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: Pet id to delete (required)
+ :type pet_id: int
+ :param api_key:
+ :type api_key: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pet_id',
+ 'api_key'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method delete_pet" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['pet_id']:
+ _path_params['petId'] = _params['pet_id']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ if _params['api_key']:
+ _header_params['api_key'] = _params['api_key']
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # authentication setting
+ _auth_settings = ['petstore_auth'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/pet/{petId}', 'DELETE',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def find_pets_by_status(self, status : Annotated[List[StrictStr], Field(..., description="Status values that need to be considered for filter")], **kwargs) -> List[Pet]: # noqa: E501
+ """Finds Pets by status # noqa: E501
+
+ Multiple status values can be provided with comma separated strings # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.find_pets_by_status(status, async_req=True)
+ >>> result = thread.get()
+
+ :param status: Status values that need to be considered for filter (required)
+ :type status: List[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: List[Pet]
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def find_pets_by_status_with_http_info(self, status : Annotated[List[StrictStr], Field(..., description="Status values that need to be considered for filter")], **kwargs): # noqa: E501
+ """Finds Pets by status # noqa: E501
+
+ Multiple status values can be provided with comma separated strings # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.find_pets_by_status_with_http_info(status, async_req=True)
+ >>> result = thread.get()
+
+ :param status: Status values that need to be considered for filter (required)
+ :type status: List[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(List[Pet], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'status'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method find_pets_by_status" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('status') is not None: # noqa: E501
+ _query_params.append(('status', _params['status']))
+ _collection_formats['status'] = 'csv'
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['http_signature_test', 'petstore_auth'] # noqa: E501
+
+ _response_types_map = {
+ '200': "List[Pet]",
+ '400': None,
+ }
+
+ return self.api_client.call_api(
+ '/pet/findByStatus', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def find_pets_by_tags(self, tags : Annotated[List[StrictStr], Field(..., description="Tags to filter by", unique_items=True)], **kwargs) -> List[Pet]: # noqa: E501
+ """Finds Pets by tags # noqa: E501
+
+ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.find_pets_by_tags(tags, async_req=True)
+ >>> result = thread.get()
+
+ :param tags: Tags to filter by (required)
+ :type tags: List[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: List[Pet]
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def find_pets_by_tags_with_http_info(self, tags : Annotated[List[StrictStr], Field(..., description="Tags to filter by", unique_items=True)], **kwargs): # noqa: E501
+ """Finds Pets by tags # noqa: E501
+
+ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True)
+ >>> result = thread.get()
+
+ :param tags: Tags to filter by (required)
+ :type tags: List[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(List[Pet], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'tags'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method find_pets_by_tags" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('tags') is not None: # noqa: E501
+ _query_params.append(('tags', _params['tags']))
+ _collection_formats['tags'] = 'csv'
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['http_signature_test', 'petstore_auth'] # noqa: E501
+
+ _response_types_map = {
+ '200': "List[Pet]",
+ '400': None,
+ }
+
+ return self.api_client.call_api(
+ '/pet/findByTags', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def get_pet_by_id(self, pet_id : Annotated[StrictInt, Field(..., description="ID of pet to return")], **kwargs) -> Pet: # noqa: E501
+ """Find pet by ID # noqa: E501
+
+ Returns a single pet # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_pet_by_id(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to return (required)
+ :type pet_id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Pet
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_pet_by_id_with_http_info(self, pet_id : Annotated[StrictInt, Field(..., description="ID of pet to return")], **kwargs): # noqa: E501
+ """Find pet by ID # noqa: E501
+
+ Returns a single pet # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_pet_by_id_with_http_info(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to return (required)
+ :type pet_id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Pet, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pet_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_pet_by_id" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['pet_id']:
+ _path_params['petId'] = _params['pet_id']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['api_key'] # noqa: E501
+
+ _response_types_map = {
+ '200': "Pet",
+ '400': None,
+ '404': None,
+ }
+
+ return self.api_client.call_api(
+ '/pet/{petId}', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def update_pet(self, pet : Annotated[Pet, Field(..., description="Pet object that needs to be added to the store")], **kwargs) -> None: # noqa: E501
+ """Update an existing pet # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_pet(pet, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.update_pet_with_http_info(pet, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def update_pet_with_http_info(self, pet : Annotated[Pet, Field(..., description="Pet object that needs to be added to the store")], **kwargs): # noqa: E501
+ """Update an existing pet # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_pet_with_http_info(pet, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pet'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_pet" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['pet']:
+ _body_params = _params['pet']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json', 'application/xml']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['http_signature_test', 'petstore_auth'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/pet', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def update_pet_with_form(self, pet_id : Annotated[StrictInt, Field(..., description="ID of pet that needs to be updated")], name : Annotated[Optional[StrictStr], Field(description="Updated name of the pet")] = None, status : Annotated[Optional[StrictStr], Field(description="Updated status of the pet")] = None, **kwargs) -> None: # noqa: E501
+ """Updates a pet in the store with form data # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_pet_with_form(pet_id, name, status, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet that needs to be updated (required)
+ :type pet_id: int
+ :param name: Updated name of the pet
+ :type name: str
+ :param status: Updated status of the pet
+ :type status: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.update_pet_with_form_with_http_info(pet_id, name, status, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def update_pet_with_form_with_http_info(self, pet_id : Annotated[StrictInt, Field(..., description="ID of pet that needs to be updated")], name : Annotated[Optional[StrictStr], Field(description="Updated name of the pet")] = None, status : Annotated[Optional[StrictStr], Field(description="Updated status of the pet")] = None, **kwargs): # noqa: E501
+ """Updates a pet in the store with form data # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_pet_with_form_with_http_info(pet_id, name, status, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet that needs to be updated (required)
+ :type pet_id: int
+ :param name: Updated name of the pet
+ :type name: str
+ :param status: Updated status of the pet
+ :type status: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pet_id',
+ 'name',
+ 'status'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_pet_with_form" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['pet_id']:
+ _path_params['petId'] = _params['pet_id']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ if _params['name']:
+ _form_params.append(('name', _params['name']))
+ if _params['status']:
+ _form_params.append(('status', _params['status']))
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/x-www-form-urlencoded']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['petstore_auth'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/pet/{petId}', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def upload_file(self, pet_id : Annotated[StrictInt, Field(..., description="ID of pet to update")], additional_metadata : Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None, file : Annotated[Optional[StrictStr], Field(description="file to upload")] = None, **kwargs) -> ApiResponse: # noqa: E501
+ """uploads an image # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.upload_file(pet_id, additional_metadata, file, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param file: file to upload
+ :type file: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: ApiResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.upload_file_with_http_info(pet_id, additional_metadata, file, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def upload_file_with_http_info(self, pet_id : Annotated[StrictInt, Field(..., description="ID of pet to update")], additional_metadata : Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None, file : Annotated[Optional[StrictStr], Field(description="file to upload")] = None, **kwargs): # noqa: E501
+ """uploads an image # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.upload_file_with_http_info(pet_id, additional_metadata, file, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param file: file to upload
+ :type file: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pet_id',
+ 'additional_metadata',
+ 'file'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method upload_file" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['pet_id']:
+ _path_params['petId'] = _params['pet_id']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ if _params['additional_metadata']:
+ _form_params.append(('additionalMetadata', _params['additional_metadata']))
+ if _params['file']:
+ _files['file'] = _params['file']
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['multipart/form-data']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['petstore_auth'] # noqa: E501
+
+ _response_types_map = {
+ '200': "ApiResponse",
+ }
+
+ return self.api_client.call_api(
+ '/pet/{petId}/uploadImage', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def upload_file_with_required_file(self, pet_id : Annotated[StrictInt, Field(..., description="ID of pet to update")], required_file : Annotated[StrictStr, Field(..., description="file to upload")], additional_metadata : Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None, **kwargs) -> ApiResponse: # noqa: E501
+ """uploads an image (required) # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.upload_file_with_required_file(pet_id, required_file, additional_metadata, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param required_file: file to upload (required)
+ :type required_file: str
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: ApiResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.upload_file_with_required_file_with_http_info(pet_id, required_file, additional_metadata, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def upload_file_with_required_file_with_http_info(self, pet_id : Annotated[StrictInt, Field(..., description="ID of pet to update")], required_file : Annotated[StrictStr, Field(..., description="file to upload")], additional_metadata : Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None, **kwargs): # noqa: E501
+ """uploads an image (required) # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, additional_metadata, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param required_file: file to upload (required)
+ :type required_file: str
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pet_id',
+ 'required_file',
+ 'additional_metadata'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method upload_file_with_required_file" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['pet_id']:
+ _path_params['petId'] = _params['pet_id']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ if _params['additional_metadata']:
+ _form_params.append(('additionalMetadata', _params['additional_metadata']))
+ if _params['required_file']:
+ _files['requiredFile'] = _params['required_file']
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['multipart/form-data']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['petstore_auth'] # noqa: E501
+
+ _response_types_map = {
+ '200': "ApiResponse",
+ }
+
+ return self.api_client.call_api(
+ '/fake/{petId}/uploadImageWithRequiredFile', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/store_api.py
new file mode 100644
index 00000000000..03a16e515ff
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/store_api.py
@@ -0,0 +1,612 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictStr, conint
+
+from typing import Dict
+
+from petstore_api.models.order import Order
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class StoreApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def delete_order(self, order_id : Annotated[StrictStr, Field(..., description="ID of the order that needs to be deleted")], **kwargs) -> None: # noqa: E501
+ """Delete purchase order by ID # noqa: E501
+
+ For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_order(order_id, async_req=True)
+ >>> result = thread.get()
+
+ :param order_id: ID of the order that needs to be deleted (required)
+ :type order_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def delete_order_with_http_info(self, order_id : Annotated[StrictStr, Field(..., description="ID of the order that needs to be deleted")], **kwargs): # noqa: E501
+ """Delete purchase order by ID # noqa: E501
+
+ For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_order_with_http_info(order_id, async_req=True)
+ >>> result = thread.get()
+
+ :param order_id: ID of the order that needs to be deleted (required)
+ :type order_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'order_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method delete_order" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['order_id']:
+ _path_params['order_id'] = _params['order_id']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/store/order/{order_id}', 'DELETE',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def get_inventory(self, **kwargs) -> Dict[str, int]: # noqa: E501
+ """Returns pet inventories by status # noqa: E501
+
+ Returns a map of status codes to quantities # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_inventory(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Dict[str, int]
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_inventory_with_http_info(**kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_inventory_with_http_info(self, **kwargs): # noqa: E501
+ """Returns pet inventories by status # noqa: E501
+
+ Returns a map of status codes to quantities # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_inventory_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Dict[str, int], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_inventory" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['api_key'] # noqa: E501
+
+ _response_types_map = {
+ '200': "Dict[str, int]",
+ }
+
+ return self.api_client.call_api(
+ '/store/inventory', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def get_order_by_id(self, order_id : Annotated[conint(strict=True, ge=5, le=1), Field(..., description="ID of pet that needs to be fetched")], **kwargs) -> Order: # noqa: E501
+ """Find purchase order by ID # noqa: E501
+
+ For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_order_by_id(order_id, async_req=True)
+ >>> result = thread.get()
+
+ :param order_id: ID of pet that needs to be fetched (required)
+ :type order_id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Order
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_order_by_id_with_http_info(self, order_id : Annotated[conint(strict=True, ge=5, le=1), Field(..., description="ID of pet that needs to be fetched")], **kwargs): # noqa: E501
+ """Find purchase order by ID # noqa: E501
+
+ For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True)
+ >>> result = thread.get()
+
+ :param order_id: ID of pet that needs to be fetched (required)
+ :type order_id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'order_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_order_by_id" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['order_id']:
+ _path_params['order_id'] = _params['order_id']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "Order",
+ '400': None,
+ '404': None,
+ }
+
+ return self.api_client.call_api(
+ '/store/order/{order_id}', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def place_order(self, order : Annotated[Order, Field(..., description="order placed for purchasing the pet")], **kwargs) -> Order: # noqa: E501
+ """Place an order for a pet # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.place_order(order, async_req=True)
+ >>> result = thread.get()
+
+ :param order: order placed for purchasing the pet (required)
+ :type order: Order
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Order
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.place_order_with_http_info(order, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def place_order_with_http_info(self, order : Annotated[Order, Field(..., description="order placed for purchasing the pet")], **kwargs): # noqa: E501
+ """Place an order for a pet # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.place_order_with_http_info(order, async_req=True)
+ >>> result = thread.get()
+
+ :param order: order placed for purchasing the pet (required)
+ :type order: Order
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'order'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method place_order" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['order']:
+ _body_params = _params['order']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "Order",
+ '400': None,
+ }
+
+ return self.api_client.call_api(
+ '/store/order', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/user_api.py
new file mode 100644
index 00000000000..5eba7fa1eef
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/user_api.py
@@ -0,0 +1,1204 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictStr
+
+from typing import List
+
+from petstore_api.models.user import User
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class UserApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def create_user(self, user : Annotated[User, Field(..., description="Created user object")], **kwargs) -> None: # noqa: E501
+ """Create user # noqa: E501
+
+ This can only be done by the logged in user. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_user(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: Created user object (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.create_user_with_http_info(user, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def create_user_with_http_info(self, user : Annotated[User, Field(..., description="Created user object")], **kwargs): # noqa: E501
+ """Create user # noqa: E501
+
+ This can only be done by the logged in user. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_user_with_http_info(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: Created user object (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _hosts = [
+ 'http://petstore.swagger.io/v2',
+ 'http://path-server-test.petstore.local/v2',
+ 'http://{server}.swagger.io:{port}/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'user'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method create_user" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['user']:
+ _body_params = _params['user']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def create_users_with_array_input(self, user : Annotated[List[User], Field(..., description="List of user object")], **kwargs) -> None: # noqa: E501
+ """Creates list of users with given input array # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_users_with_array_input(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: List of user object (required)
+ :type user: List[User]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.create_users_with_array_input_with_http_info(user, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def create_users_with_array_input_with_http_info(self, user : Annotated[List[User], Field(..., description="List of user object")], **kwargs): # noqa: E501
+ """Creates list of users with given input array # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_users_with_array_input_with_http_info(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: List of user object (required)
+ :type user: List[User]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'user'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method create_users_with_array_input" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['user']:
+ _body_params = _params['user']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/createWithArray', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def create_users_with_list_input(self, user : Annotated[List[User], Field(..., description="List of user object")], **kwargs) -> None: # noqa: E501
+ """Creates list of users with given input array # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_users_with_list_input(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: List of user object (required)
+ :type user: List[User]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.create_users_with_list_input_with_http_info(user, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def create_users_with_list_input_with_http_info(self, user : Annotated[List[User], Field(..., description="List of user object")], **kwargs): # noqa: E501
+ """Creates list of users with given input array # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_users_with_list_input_with_http_info(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: List of user object (required)
+ :type user: List[User]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'user'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method create_users_with_list_input" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['user']:
+ _body_params = _params['user']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/createWithList', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def delete_user(self, username : Annotated[StrictStr, Field(..., description="The name that needs to be deleted")], **kwargs) -> None: # noqa: E501
+ """Delete user # noqa: E501
+
+ This can only be done by the logged in user. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_user(username, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The name that needs to be deleted (required)
+ :type username: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.delete_user_with_http_info(username, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def delete_user_with_http_info(self, username : Annotated[StrictStr, Field(..., description="The name that needs to be deleted")], **kwargs): # noqa: E501
+ """Delete user # noqa: E501
+
+ This can only be done by the logged in user. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_user_with_http_info(username, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The name that needs to be deleted (required)
+ :type username: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'username'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method delete_user" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['username']:
+ _path_params['username'] = _params['username']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/{username}', 'DELETE',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def get_user_by_name(self, username : Annotated[StrictStr, Field(..., description="The name that needs to be fetched. Use user1 for testing.")], **kwargs) -> User: # noqa: E501
+ """Get user by user name # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_user_by_name(username, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The name that needs to be fetched. Use user1 for testing. (required)
+ :type username: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: User
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_user_by_name_with_http_info(self, username : Annotated[StrictStr, Field(..., description="The name that needs to be fetched. Use user1 for testing.")], **kwargs): # noqa: E501
+ """Get user by user name # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_user_by_name_with_http_info(username, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The name that needs to be fetched. Use user1 for testing. (required)
+ :type username: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'username'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_user_by_name" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['username']:
+ _path_params['username'] = _params['username']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "User",
+ '400': None,
+ '404': None,
+ }
+
+ return self.api_client.call_api(
+ '/user/{username}', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def login_user(self, username : Annotated[StrictStr, Field(..., description="The user name for login")], password : Annotated[StrictStr, Field(..., description="The password for login in clear text")], **kwargs) -> str: # noqa: E501
+ """Logs user into the system # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.login_user(username, password, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The user name for login (required)
+ :type username: str
+ :param password: The password for login in clear text (required)
+ :type password: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: str
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def login_user_with_http_info(self, username : Annotated[StrictStr, Field(..., description="The user name for login")], password : Annotated[StrictStr, Field(..., description="The password for login in clear text")], **kwargs): # noqa: E501
+ """Logs user into the system # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.login_user_with_http_info(username, password, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The user name for login (required)
+ :type username: str
+ :param password: The password for login in clear text (required)
+ :type password: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'username',
+ 'password'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method login_user" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('username') is not None: # noqa: E501
+ _query_params.append(('username', _params['username']))
+ if _params.get('password') is not None: # noqa: E501
+ _query_params.append(('password', _params['password']))
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "str",
+ '400': None,
+ }
+
+ return self.api_client.call_api(
+ '/user/login', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def logout_user(self, **kwargs) -> None: # noqa: E501
+ """Logs out current logged in user session # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.logout_user(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.logout_user_with_http_info(**kwargs) # noqa: E501
+
+ @validate_arguments
+ def logout_user_with_http_info(self, **kwargs): # noqa: E501
+ """Logs out current logged in user session # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.logout_user_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method logout_user" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/logout', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def update_user(self, username : Annotated[StrictStr, Field(..., description="name that need to be deleted")], user : Annotated[User, Field(..., description="Updated user object")], **kwargs) -> None: # noqa: E501
+ """Updated user # noqa: E501
+
+ This can only be done by the logged in user. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_user(username, user, async_req=True)
+ >>> result = thread.get()
+
+ :param username: name that need to be deleted (required)
+ :type username: str
+ :param user: Updated user object (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.update_user_with_http_info(username, user, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def update_user_with_http_info(self, username : Annotated[StrictStr, Field(..., description="name that need to be deleted")], user : Annotated[User, Field(..., description="Updated user object")], **kwargs): # noqa: E501
+ """Updated user # noqa: E501
+
+ This can only be done by the logged in user. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_user_with_http_info(username, user, async_req=True)
+ >>> result = thread.get()
+
+ :param username: name that need to be deleted (required)
+ :type username: str
+ :param user: Updated user object (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'username',
+ 'user'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_user" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['username']:
+ _path_params['username'] = _params['username']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['user']:
+ _body_params = _params['user']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/{username}', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api_client.py
new file mode 100644
index 00000000000..aaec79362f7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api_client.py
@@ -0,0 +1,753 @@
+# coding: utf-8
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+from __future__ import absolute_import
+
+import atexit
+import datetime
+from dateutil.parser import parse
+import json
+import mimetypes
+from multiprocessing.pool import ThreadPool
+import os
+import re
+import tempfile
+
+from urllib.parse import quote
+
+from petstore_api.configuration import Configuration
+import petstore_api.models
+from petstore_api import rest
+from petstore_api.exceptions import ApiValueError, ApiException
+
+
+class ApiClient(object):
+ """Generic API client for OpenAPI client library builds.
+
+ OpenAPI generic API client. This client handles the client-
+ server communication, and is invariant across implementations. Specifics of
+ the methods and models for each application are generated from the OpenAPI
+ templates.
+
+ NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+ Do not edit the class manually.
+
+ :param configuration: .Configuration object for this client
+ :param header_name: a header to pass when making calls to the API.
+ :param header_value: a header value to pass when making calls to
+ the API.
+ :param cookie: a cookie to include in the header when making calls
+ to the API
+ :param pool_threads: The number of threads to use for async requests
+ to the API. More threads means more concurrent API requests.
+ """
+
+ PRIMITIVE_TYPES = (float, bool, bytes, str, int)
+ NATIVE_TYPES_MAPPING = {
+ 'int': int,
+ 'long': int, # TODO remove as only py3 is supported?
+ 'float': float,
+ 'str': str,
+ 'bool': bool,
+ 'date': datetime.date,
+ 'datetime': datetime.datetime,
+ 'object': object,
+ }
+ _pool = None
+
+ def __init__(self, configuration=None, header_name=None, header_value=None,
+ cookie=None, pool_threads=1):
+ # use default configuraiton if none is provided
+ if configuration is None:
+ configuration = Configuration.get_default()
+ self.configuration = configuration
+ self.pool_threads = pool_threads
+
+ self.rest_client = rest.RESTClientObject(configuration)
+ self.default_headers = {}
+ if header_name is not None:
+ self.default_headers[header_name] = header_value
+ self.cookie = cookie
+ # Set default User-Agent.
+ self.user_agent = 'OpenAPI-Generator/1.0.0/python'
+ self.client_side_validation = configuration.client_side_validation
+
+ async def __aenter__(self):
+ return self
+
+ async def __aexit__(self, exc_type, exc_value, traceback):
+ await self.close()
+
+ async def close(self):
+ await self.rest_client.close()
+ if self._pool:
+ self._pool.close()
+ self._pool.join()
+ self._pool = None
+ if hasattr(atexit, 'unregister'):
+ atexit.unregister(self.close)
+
+ @property
+ def pool(self):
+ """Create thread pool on first request
+ avoids instantiating unused threadpool for blocking clients.
+ """
+ if self._pool is None:
+ atexit.register(self.close)
+ self._pool = ThreadPool(self.pool_threads)
+ return self._pool
+
+ @property
+ def user_agent(self):
+ """User agent for this API client"""
+ return self.default_headers['User-Agent']
+
+ @user_agent.setter
+ def user_agent(self, value):
+ self.default_headers['User-Agent'] = value
+
+ def set_default_header(self, header_name, header_value):
+ self.default_headers[header_name] = header_value
+
+
+ _default = None
+
+ @classmethod
+ def get_default(cls):
+ """Return new instance of ApiClient.
+
+ This method returns newly created, based on default constructor,
+ object of ApiClient class or returns a copy of default
+ ApiClient.
+
+ :return: The ApiClient object.
+ """
+ if cls._default is None:
+ cls._default = ApiClient()
+ return cls._default
+
+ @classmethod
+ def set_default(cls, default):
+ """Set default instance of ApiClient.
+
+ It stores default ApiClient.
+
+ :param default: object of ApiClient.
+ """
+ cls._default = default
+
+ async def __call_api(
+ self, resource_path, method, path_params=None,
+ query_params=None, header_params=None, body=None, post_params=None,
+ files=None, response_types_map=None, auth_settings=None,
+ _return_http_data_only=None, collection_formats=None,
+ _preload_content=True, _request_timeout=None, _host=None,
+ _request_auth=None):
+
+ config = self.configuration
+
+ # header parameters
+ header_params = header_params or {}
+ header_params.update(self.default_headers)
+ if self.cookie:
+ header_params['Cookie'] = self.cookie
+ if header_params:
+ header_params = self.sanitize_for_serialization(header_params)
+ header_params = dict(self.parameters_to_tuples(header_params,
+ collection_formats))
+
+ # path parameters
+ if path_params:
+ path_params = self.sanitize_for_serialization(path_params)
+ path_params = self.parameters_to_tuples(path_params,
+ collection_formats)
+ for k, v in path_params:
+ # specified safe chars, encode everything
+ resource_path = resource_path.replace(
+ '{%s}' % k,
+ quote(str(v), safe=config.safe_chars_for_path_param)
+ )
+
+ # post parameters
+ if post_params or files:
+ post_params = post_params if post_params else []
+ post_params = self.sanitize_for_serialization(post_params)
+ post_params = self.parameters_to_tuples(post_params,
+ collection_formats)
+ post_params.extend(self.files_parameters(files))
+
+ # auth setting
+ self.update_params_for_auth(
+ header_params, query_params, auth_settings,
+ resource_path, method, body,
+ request_auth=_request_auth)
+
+ # body
+ if body:
+ body = self.sanitize_for_serialization(body)
+
+ # request url
+ if _host is None:
+ url = self.configuration.host + resource_path
+ else:
+ # use server/host defined in path or operation instead
+ url = _host + resource_path
+
+ # query parameters
+ if query_params:
+ query_params = self.sanitize_for_serialization(query_params)
+ url_query = self.parameters_to_url_query(query_params,
+ collection_formats)
+ url += "?" + url_query
+
+ try:
+ # perform request and return response
+ response_data = await self.request(
+ method, url,
+ query_params=query_params,
+ headers=header_params,
+ post_params=post_params, body=body,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout)
+ except ApiException as e:
+ if e.body:
+ e.body = e.body.decode('utf-8')
+ raise e
+
+ self.last_response = response_data
+
+ return_data = response_data
+
+ if not _preload_content:
+ return return_data
+
+ response_type = response_types_map.get(str(response_data.status), None)
+
+ if response_type not in ["file", "bytes"]:
+ match = None
+ content_type = response_data.getheader('content-type')
+ if content_type is not None:
+ match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
+ encoding = match.group(1) if match else "utf-8"
+ response_data.data = response_data.data.decode(encoding)
+
+ # deserialize response data
+
+ if response_type:
+ return_data = self.deserialize(response_data, response_type)
+ else:
+ return_data = None
+
+ if _return_http_data_only:
+ return (return_data)
+ else:
+ return (return_data, response_data.status,
+ response_data.getheaders())
+
+ def sanitize_for_serialization(self, obj):
+ """Builds a JSON POST object.
+
+ If obj is None, return None.
+ If obj is str, int, long, float, bool, return directly.
+ If obj is datetime.datetime, datetime.date
+ convert to string in iso8601 format.
+ If obj is list, sanitize each element in the list.
+ If obj is dict, return the dict.
+ If obj is OpenAPI model, return the properties dict.
+
+ :param obj: The data to serialize.
+ :return: The serialized form of data.
+ """
+ if obj is None:
+ return None
+ elif isinstance(obj, self.PRIMITIVE_TYPES):
+ return obj
+ elif isinstance(obj, list):
+ return [self.sanitize_for_serialization(sub_obj)
+ for sub_obj in obj]
+ elif isinstance(obj, tuple):
+ return tuple(self.sanitize_for_serialization(sub_obj)
+ for sub_obj in obj)
+ elif isinstance(obj, (datetime.datetime, datetime.date)):
+ return obj.isoformat()
+
+ if isinstance(obj, dict):
+ obj_dict = obj
+ else:
+ # Convert model obj to dict except
+ # attributes `openapi_types`, `attribute_map`
+ # and attributes which value is not None.
+ # Convert attribute name to json key in
+ # model definition for request.
+ obj_dict = obj.to_dict()
+
+ return {key: self.sanitize_for_serialization(val)
+ for key, val in obj_dict.items()}
+
+ def deserialize(self, response, response_type):
+ """Deserializes response into an object.
+
+ :param response: RESTResponse object to be deserialized.
+ :param response_type: class literal for
+ deserialized object, or string of class name.
+
+ :return: deserialized object.
+ """
+ # handle file downloading
+ # save response body into a tmp file and return the instance
+ if response_type == "file":
+ return self.__deserialize_file(response)
+
+ # fetch data from response object
+ try:
+ data = json.loads(response.data)
+ except ValueError:
+ data = response.data
+
+ return self.__deserialize(data, response_type)
+
+ def __deserialize(self, data, klass):
+ """Deserializes dict, list, str into an object.
+
+ :param data: dict, list or str.
+ :param klass: class literal, or string of class name.
+
+ :return: object.
+ """
+ if data is None:
+ return None
+
+ if type(klass) == str:
+ if klass.startswith('List['):
+ sub_kls = re.match(r'List\[(.*)]', klass).group(1)
+ return [self.__deserialize(sub_data, sub_kls)
+ for sub_data in data]
+
+ if klass.startswith('Dict['):
+ sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2)
+ return {k: self.__deserialize(v, sub_kls)
+ for k, v in data.items()}
+
+ # convert str to class
+ if klass in self.NATIVE_TYPES_MAPPING:
+ klass = self.NATIVE_TYPES_MAPPING[klass]
+ else:
+ klass = getattr(petstore_api.models, klass)
+
+ if klass in self.PRIMITIVE_TYPES:
+ return self.__deserialize_primitive(data, klass)
+ elif klass == object:
+ return self.__deserialize_object(data)
+ elif klass == datetime.date:
+ return self.__deserialize_date(data)
+ elif klass == datetime.datetime:
+ return self.__deserialize_datetime(data)
+ else:
+ return self.__deserialize_model(data, klass)
+
+ def call_api(self, resource_path, method,
+ path_params=None, query_params=None, header_params=None,
+ body=None, post_params=None, files=None,
+ response_types_map=None, auth_settings=None,
+ async_req=None, _return_http_data_only=None,
+ collection_formats=None,_preload_content=True,
+ _request_timeout=None, _host=None, _request_auth=None):
+ """Makes the HTTP request (synchronous) and returns deserialized data.
+
+ To make an async_req request, set the async_req parameter.
+
+ :param resource_path: Path to method endpoint.
+ :param method: Method to call.
+ :param path_params: Path parameters in the url.
+ :param query_params: Query parameters in the url.
+ :param header_params: Header parameters to be
+ placed in the request header.
+ :param body: Request body.
+ :param post_params dict: Request post form parameters,
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
+ :param auth_settings list: Auth Settings names for the request.
+ :param response: Response data type.
+ :param files dict: key -> filename, value -> filepath,
+ for `multipart/form-data`.
+ :param async_req bool: execute request asynchronously
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :param collection_formats: dict of collection formats for path, query,
+ header, and post parameters.
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_token: dict, optional
+ :return:
+ If async_req parameter is True,
+ the request will be called asynchronously.
+ The method will return the request thread.
+ If parameter async_req is False or missing,
+ then the method will return the response directly.
+ """
+ if not async_req:
+ return self.__call_api(resource_path, method,
+ path_params, query_params, header_params,
+ body, post_params, files,
+ response_types_map, auth_settings,
+ _return_http_data_only, collection_formats,
+ _preload_content, _request_timeout, _host,
+ _request_auth)
+
+ return self.pool.apply_async(self.__call_api, (resource_path,
+ method, path_params,
+ query_params,
+ header_params, body,
+ post_params, files,
+ response_types_map,
+ auth_settings,
+ _return_http_data_only,
+ collection_formats,
+ _preload_content,
+ _request_timeout,
+ _host, _request_auth))
+
+ def request(self, method, url, query_params=None, headers=None,
+ post_params=None, body=None, _preload_content=True,
+ _request_timeout=None):
+ """Makes the HTTP request using RESTClient."""
+ if method == "GET":
+ return self.rest_client.get_request(url,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ headers=headers)
+ elif method == "HEAD":
+ return self.rest_client.head_request(url,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ headers=headers)
+ elif method == "OPTIONS":
+ return self.rest_client.options_request(url,
+ query_params=query_params,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout)
+ elif method == "POST":
+ return self.rest_client.post_request(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "PUT":
+ return self.rest_client.put_request(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "PATCH":
+ return self.rest_client.patch_request(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "DELETE":
+ return self.rest_client.delete_request(url,
+ query_params=query_params,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ else:
+ raise ApiValueError(
+ "http method must be `GET`, `HEAD`, `OPTIONS`,"
+ " `POST`, `PATCH`, `PUT` or `DELETE`."
+ )
+
+ def parameters_to_tuples(self, params, collection_formats):
+ """Get parameters as list of tuples, formatting collections.
+
+ :param params: Parameters as dict or list of two-tuples
+ :param dict collection_formats: Parameter collection formats
+ :return: Parameters as list of tuples, collections formatted
+ """
+ new_params = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == 'multi':
+ new_params.extend((k, value) for value in v)
+ else:
+ if collection_format == 'ssv':
+ delimiter = ' '
+ elif collection_format == 'tsv':
+ delimiter = '\t'
+ elif collection_format == 'pipes':
+ delimiter = '|'
+ else: # csv is the default
+ delimiter = ','
+ new_params.append(
+ (k, delimiter.join(str(value) for value in v)))
+ else:
+ new_params.append((k, v))
+ return new_params
+
+ def parameters_to_url_query(self, params, collection_formats):
+ """Get parameters as list of tuples, formatting collections.
+
+ :param params: Parameters as dict or list of two-tuples
+ :param dict collection_formats: Parameter collection formats
+ :return: URL query string (e.g. a=Hello%20World&b=123)
+ """
+ new_params = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == 'multi':
+ new_params.extend((k, value) for value in v)
+ else:
+ if collection_format == 'ssv':
+ delimiter = ' '
+ elif collection_format == 'tsv':
+ delimiter = '\t'
+ elif collection_format == 'pipes':
+ delimiter = '|'
+ else: # csv is the default
+ delimiter = ','
+ new_params.append(
+ (k, delimiter.join(quote(str(value)) for value in v)))
+ else:
+ new_params.append((k, v))
+
+ return "&".join(["=".join(item) for item in new_params])
+
+ def files_parameters(self, files=None):
+ """Builds form parameters.
+
+ :param files: File parameters.
+ :return: Form parameters with files.
+ """
+ params = []
+
+ if files:
+ for k, v in files.items():
+ if not v:
+ continue
+ file_names = v if type(v) is list else [v]
+ for n in file_names:
+ with open(n, 'rb') as f:
+ filename = os.path.basename(f.name)
+ filedata = f.read()
+ mimetype = (mimetypes.guess_type(filename)[0] or
+ 'application/octet-stream')
+ params.append(
+ tuple([k, tuple([filename, filedata, mimetype])]))
+
+ return params
+
+ def select_header_accept(self, accepts):
+ """Returns `Accept` based on an array of accepts provided.
+
+ :param accepts: List of headers.
+ :return: Accept (e.g. application/json).
+ """
+ if not accepts:
+ return
+
+ for accept in accepts:
+ if re.search('json', accept, re.IGNORECASE):
+ return accept
+
+ return accepts[0]
+
+ def select_header_content_type(self, content_types):
+ """Returns `Content-Type` based on an array of content_types provided.
+
+ :param content_types: List of content-types.
+ :return: Content-Type (e.g. application/json).
+ """
+ if not content_types:
+ return None
+
+ for content_type in content_types:
+ if re.search('json', content_type, re.IGNORECASE):
+ return content_type
+
+ return content_types[0]
+
+ def update_params_for_auth(self, headers, queries, auth_settings,
+ resource_path, method, body,
+ request_auth=None):
+ """Updates header and query params based on authentication setting.
+
+ :param headers: Header parameters dict to be updated.
+ :param queries: Query parameters tuple list to be updated.
+ :param auth_settings: Authentication setting identifiers list.
+ :resource_path: A string representation of the HTTP request resource path.
+ :method: A string representation of the HTTP request method.
+ :body: A object representing the body of the HTTP request.
+ The object type is the return value of sanitize_for_serialization().
+ :param request_auth: if set, the provided settings will
+ override the token in the configuration.
+ """
+ if not auth_settings:
+ return
+
+ if request_auth:
+ self._apply_auth_params(headers, queries,
+ resource_path, method, body,
+ request_auth)
+ return
+
+ for auth in auth_settings:
+ auth_setting = self.configuration.auth_settings().get(auth)
+ if auth_setting:
+ self._apply_auth_params(headers, queries,
+ resource_path, method, body,
+ auth_setting)
+
+ def _apply_auth_params(self, headers, queries,
+ resource_path, method, body,
+ auth_setting):
+ """Updates the request parameters based on a single auth_setting
+
+ :param headers: Header parameters dict to be updated.
+ :param queries: Query parameters tuple list to be updated.
+ :resource_path: A string representation of the HTTP request resource path.
+ :method: A string representation of the HTTP request method.
+ :body: A object representing the body of the HTTP request.
+ The object type is the return value of sanitize_for_serialization().
+ :param auth_setting: auth settings for the endpoint
+ """
+ if auth_setting['in'] == 'cookie':
+ headers['Cookie'] = auth_setting['value']
+ elif auth_setting['in'] == 'header':
+ if auth_setting['type'] != 'http-signature':
+ headers[auth_setting['key']] = auth_setting['value']
+ else:
+ # The HTTP signature scheme requires multiple HTTP headers
+ # that are calculated dynamically.
+ signing_info = self.configuration.signing_info
+ auth_headers = signing_info.get_http_signature_headers(
+ resource_path, method, headers, body, queries)
+ headers.update(auth_headers)
+ elif auth_setting['in'] == 'query':
+ queries.append((auth_setting['key'], auth_setting['value']))
+ else:
+ raise ApiValueError(
+ 'Authentication token must be in `query` or `header`'
+ )
+
+ def __deserialize_file(self, response):
+ """Deserializes body to file
+
+ Saves response body into a file in a temporary folder,
+ using the filename from the `Content-Disposition` header if provided.
+
+ :param response: RESTResponse.
+ :return: file path.
+ """
+ fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
+ os.close(fd)
+ os.remove(path)
+
+ content_disposition = response.getheader("Content-Disposition")
+ if content_disposition:
+ filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
+ content_disposition).group(1)
+ path = os.path.join(os.path.dirname(path), filename)
+
+ with open(path, "wb") as f:
+ f.write(response.data)
+
+ return path
+
+ def __deserialize_primitive(self, data, klass):
+ """Deserializes string to primitive type.
+
+ :param data: str.
+ :param klass: class literal.
+
+ :return: int, long, float, str, bool.
+ """
+ try:
+ return klass(data)
+ except UnicodeEncodeError:
+ return str(data)
+ except TypeError:
+ return data
+
+ def __deserialize_object(self, value):
+ """Return an original value.
+
+ :return: object.
+ """
+ return value
+
+ def __deserialize_date(self, string):
+ """Deserializes string to date.
+
+ :param string: str.
+ :return: date.
+ """
+ try:
+ return parse(string).date()
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason="Failed to parse `{0}` as date object".format(string)
+ )
+
+ def __deserialize_datetime(self, string):
+ """Deserializes string to datetime.
+
+ The string should be in iso8601 datetime format.
+
+ :param string: str.
+ :return: datetime.
+ """
+ try:
+ return parse(string)
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason=(
+ "Failed to parse `{0}` as datetime object"
+ .format(string)
+ )
+ )
+
+ def __deserialize_model(self, data, klass):
+ """Deserializes list or dict to model.
+
+ :param data: dict, list.
+ :param klass: class literal.
+ :return: model object.
+ """
+
+ return klass.from_dict(data)
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/configuration.py
new file mode 100644
index 00000000000..8c22f571fbf
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/configuration.py
@@ -0,0 +1,626 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import copy
+import logging
+import sys
+import urllib3
+
+import http.client as httplib
+from petstore_api.exceptions import ApiValueError
+
+
+JSON_SCHEMA_VALIDATION_KEYWORDS = {
+ 'multipleOf', 'maximum', 'exclusiveMaximum',
+ 'minimum', 'exclusiveMinimum', 'maxLength',
+ 'minLength', 'pattern', 'maxItems', 'minItems'
+}
+
+class Configuration(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+
+ Ref: https://openapi-generator.tech
+ Do not edit the class manually.
+
+ :param host: Base url.
+ :param api_key: Dict to store API key(s).
+ Each entry in the dict specifies an API key.
+ The dict key is the name of the security scheme in the OAS specification.
+ The dict value is the API key secret.
+ :param api_key_prefix: Dict to store API prefix (e.g. Bearer).
+ The dict key is the name of the security scheme in the OAS specification.
+ The dict value is an API key prefix when generating the auth data.
+ :param username: Username for HTTP basic authentication.
+ :param password: Password for HTTP basic authentication.
+ :param discard_unknown_keys: Boolean value indicating whether to discard
+ unknown properties. A server may send a response that includes additional
+ properties that are not known by the client in the following scenarios:
+ 1. The OpenAPI document is incomplete, i.e. it does not match the server
+ implementation.
+ 2. The client was generated using an older version of the OpenAPI document
+ and the server has been upgraded since then.
+ If a schema in the OpenAPI document defines the additionalProperties attribute,
+ then all undeclared properties received by the server are injected into the
+ additional properties map. In that case, there are undeclared properties, and
+ nothing to discard.
+ :param disabled_client_side_validations (string): Comma-separated list of
+ JSON schema validation keywords to disable JSON schema structural validation
+ rules. The following keywords may be specified: multipleOf, maximum,
+ exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern,
+ maxItems, minItems.
+ By default, the validation is performed for data generated locally by the client
+ and data received from the server, independent of any validation performed by
+ the server side. If the input data does not satisfy the JSON schema validation
+ rules specified in the OpenAPI document, an exception is raised.
+ If disabled_client_side_validations is set, structural validation is
+ disabled. This can be useful to troubleshoot data validation problem, such as
+ when the OpenAPI document validation rules do not match the actual API data
+ received by the server.
+ :param signing_info: Configuration parameters for the HTTP signature security scheme.
+ Must be an instance of petstore_api.signing.HttpSigningConfiguration
+ :param server_index: Index to servers configuration.
+ :param server_variables: Mapping with string values to replace variables in
+ templated server configuration. The validation of enums is performed for
+ variables with defined enum values before.
+ :param server_operation_index: Mapping from operation ID to an index to server
+ configuration.
+ :param server_operation_variables: Mapping from operation ID to a mapping with
+ string values to replace variables in templated server configuration.
+ The validation of enums is performed for variables with defined enum values before.
+ :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
+ in PEM format.
+
+ :Example:
+
+ API Key Authentication Example.
+ Given the following security scheme in the OpenAPI specification:
+ components:
+ securitySchemes:
+ cookieAuth: # name for the security scheme
+ type: apiKey
+ in: cookie
+ name: JSESSIONID # cookie name
+
+ You can programmatically set the cookie:
+
+conf = petstore_api.Configuration(
+ api_key={'cookieAuth': 'abc123'}
+ api_key_prefix={'cookieAuth': 'JSESSIONID'}
+)
+
+ The following cookie will be added to the HTTP request:
+ Cookie: JSESSIONID abc123
+
+ HTTP Basic Authentication Example.
+ Given the following security scheme in the OpenAPI specification:
+ components:
+ securitySchemes:
+ http_basic_auth:
+ type: http
+ scheme: basic
+
+ Configure API client with HTTP basic authentication:
+
+conf = petstore_api.Configuration(
+ username='the-user',
+ password='the-password',
+)
+
+
+ HTTP Signature Authentication Example.
+ Given the following security scheme in the OpenAPI specification:
+ components:
+ securitySchemes:
+ http_basic_auth:
+ type: http
+ scheme: signature
+
+ Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme,
+ sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time
+ of the signature to 5 minutes after the signature has been created.
+ Note you can use the constants defined in the petstore_api.signing module, and you can
+ also specify arbitrary HTTP headers to be included in the HTTP signature, except for the
+ 'Authorization' header, which is used to carry the signature.
+
+ One may be tempted to sign all headers by default, but in practice it rarely works.
+ This is because explicit proxies, transparent proxies, TLS termination endpoints or
+ load balancers may add/modify/remove headers. Include the HTTP headers that you know
+ are not going to be modified in transit.
+
+conf = petstore_api.Configuration(
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'rsa.pem',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_RSASSA_PSS,
+ signed_headers = [petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+ """
+
+ _default = None
+
+ def __init__(self, host=None,
+ api_key=None, api_key_prefix=None,
+ username=None, password=None,
+ discard_unknown_keys=False,
+ disabled_client_side_validations="",
+ signing_info=None,
+ server_index=None, server_variables=None,
+ server_operation_index=None, server_operation_variables=None,
+ ssl_ca_cert=None,
+ ):
+ """Constructor
+ """
+ self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host
+ """Default Base url
+ """
+ self.server_index = 0 if server_index is None and host is None else server_index
+ self.server_operation_index = server_operation_index or {}
+ """Default server index
+ """
+ self.server_variables = server_variables or {}
+ self.server_operation_variables = server_operation_variables or {}
+ """Default server variables
+ """
+ self.temp_folder_path = None
+ """Temp file folder for downloading files
+ """
+ # Authentication Settings
+ self.api_key = {}
+ if api_key:
+ self.api_key = api_key
+ """dict to store API key(s)
+ """
+ self.api_key_prefix = {}
+ if api_key_prefix:
+ self.api_key_prefix = api_key_prefix
+ """dict to store API prefix (e.g. Bearer)
+ """
+ self.refresh_api_key_hook = None
+ """function hook to refresh API key if expired
+ """
+ self.username = username
+ """Username for HTTP basic authentication
+ """
+ self.password = password
+ """Password for HTTP basic authentication
+ """
+ self.discard_unknown_keys = discard_unknown_keys
+ self.disabled_client_side_validations = disabled_client_side_validations
+ if signing_info is not None:
+ signing_info.host = host
+ self.signing_info = signing_info
+ """The HTTP signing configuration
+ """
+ self.access_token = None
+ """access token for OAuth/Bearer
+ """
+ self.logger = {}
+ """Logging Settings
+ """
+ self.logger["package_logger"] = logging.getLogger("petstore_api")
+ self.logger["urllib3_logger"] = logging.getLogger("urllib3")
+ self.logger_format = '%(asctime)s %(levelname)s %(message)s'
+ """Log format
+ """
+ self.logger_stream_handler = None
+ """Log stream handler
+ """
+ self.logger_file_handler = None
+ """Log file handler
+ """
+ self.logger_file = None
+ """Debug file location
+ """
+ self.debug = False
+ """Debug switch
+ """
+
+ self.verify_ssl = True
+ """SSL/TLS verification
+ Set this to false to skip verifying SSL certificate when calling API
+ from https server.
+ """
+ self.ssl_ca_cert = ssl_ca_cert
+ """Set this to customize the certificate file to verify the peer.
+ """
+ self.cert_file = None
+ """client certificate file
+ """
+ self.key_file = None
+ """client key file
+ """
+ self.assert_hostname = None
+ """Set this to True/False to enable/disable SSL hostname verification.
+ """
+
+ self.connection_pool_maxsize = 100
+ """This value is passed to the aiohttp to limit simultaneous connections.
+ Default values is 100, None means no-limit.
+ """
+
+ self.proxy = None
+ """Proxy URL
+ """
+ self.proxy_headers = None
+ """Proxy headers
+ """
+ self.safe_chars_for_path_param = ''
+ """Safe chars for path_param
+ """
+ self.retries = None
+ """Adding retries to override urllib3 default value 3
+ """
+ # Enable client side validation
+ self.client_side_validation = True
+
+ self.socket_options = None
+ """Options to pass down to the underlying urllib3 socket
+ """
+
+ def __deepcopy__(self, memo):
+ cls = self.__class__
+ result = cls.__new__(cls)
+ memo[id(self)] = result
+ for k, v in self.__dict__.items():
+ if k not in ('logger', 'logger_file_handler'):
+ setattr(result, k, copy.deepcopy(v, memo))
+ # shallow copy of loggers
+ result.logger = copy.copy(self.logger)
+ # use setters to configure loggers
+ result.logger_file = self.logger_file
+ result.debug = self.debug
+ return result
+
+ def __setattr__(self, name, value):
+ object.__setattr__(self, name, value)
+ if name == 'disabled_client_side_validations':
+ s = set(filter(None, value.split(',')))
+ for v in s:
+ if v not in JSON_SCHEMA_VALIDATION_KEYWORDS:
+ raise ApiValueError(
+ "Invalid keyword: '{0}''".format(v))
+ self._disabled_client_side_validations = s
+ if name == "signing_info" and value is not None:
+ # Ensure the host parameter from signing info is the same as
+ # Configuration.host.
+ value.host = self.host
+
+ @classmethod
+ def set_default(cls, default):
+ """Set default instance of configuration.
+
+ It stores default configuration, which can be
+ returned by get_default_copy method.
+
+ :param default: object of Configuration
+ """
+ cls._default = default
+
+ @classmethod
+ def get_default_copy(cls):
+ """Deprecated. Please use `get_default` instead.
+
+ Deprecated. Please use `get_default` instead.
+
+ :return: The configuration object.
+ """
+ return cls.get_default()
+
+ @classmethod
+ def get_default(cls):
+ """Return the default configuration.
+
+ This method returns newly created, based on default constructor,
+ object of Configuration class or returns a copy of default
+ configuration.
+
+ :return: The configuration object.
+ """
+ if cls._default is None:
+ cls._default = Configuration()
+ return cls._default
+
+ @property
+ def logger_file(self):
+ """The logger file.
+
+ If the logger_file is None, then add stream handler and remove file
+ handler. Otherwise, add file handler and remove stream handler.
+
+ :param value: The logger_file path.
+ :type: str
+ """
+ return self.__logger_file
+
+ @logger_file.setter
+ def logger_file(self, value):
+ """The logger file.
+
+ If the logger_file is None, then add stream handler and remove file
+ handler. Otherwise, add file handler and remove stream handler.
+
+ :param value: The logger_file path.
+ :type: str
+ """
+ self.__logger_file = value
+ if self.__logger_file:
+ # If set logging file,
+ # then add file handler and remove stream handler.
+ self.logger_file_handler = logging.FileHandler(self.__logger_file)
+ self.logger_file_handler.setFormatter(self.logger_formatter)
+ for _, logger in self.logger.items():
+ logger.addHandler(self.logger_file_handler)
+
+ @property
+ def debug(self):
+ """Debug status
+
+ :param value: The debug status, True or False.
+ :type: bool
+ """
+ return self.__debug
+
+ @debug.setter
+ def debug(self, value):
+ """Debug status
+
+ :param value: The debug status, True or False.
+ :type: bool
+ """
+ self.__debug = value
+ if self.__debug:
+ # if debug status is True, turn on debug logging
+ for _, logger in self.logger.items():
+ logger.setLevel(logging.DEBUG)
+ # turn on httplib debug
+ httplib.HTTPConnection.debuglevel = 1
+ else:
+ # if debug status is False, turn off debug logging,
+ # setting log level to default `logging.WARNING`
+ for _, logger in self.logger.items():
+ logger.setLevel(logging.WARNING)
+ # turn off httplib debug
+ httplib.HTTPConnection.debuglevel = 0
+
+ @property
+ def logger_format(self):
+ """The logger format.
+
+ The logger_formatter will be updated when sets logger_format.
+
+ :param value: The format string.
+ :type: str
+ """
+ return self.__logger_format
+
+ @logger_format.setter
+ def logger_format(self, value):
+ """The logger format.
+
+ The logger_formatter will be updated when sets logger_format.
+
+ :param value: The format string.
+ :type: str
+ """
+ self.__logger_format = value
+ self.logger_formatter = logging.Formatter(self.__logger_format)
+
+ def get_api_key_with_prefix(self, identifier, alias=None):
+ """Gets API key (with prefix if set).
+
+ :param identifier: The identifier of apiKey.
+ :param alias: The alternative identifier of apiKey.
+ :return: The token for api key authentication.
+ """
+ if self.refresh_api_key_hook is not None:
+ self.refresh_api_key_hook(self)
+ key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
+ if key:
+ prefix = self.api_key_prefix.get(identifier)
+ if prefix:
+ return "%s %s" % (prefix, key)
+ else:
+ return key
+
+ def get_basic_auth_token(self):
+ """Gets HTTP basic authentication header (string).
+
+ :return: The token for basic HTTP authentication.
+ """
+ username = ""
+ if self.username is not None:
+ username = self.username
+ password = ""
+ if self.password is not None:
+ password = self.password
+ return urllib3.util.make_headers(
+ basic_auth=username + ':' + password
+ ).get('authorization')
+
+ def auth_settings(self):
+ """Gets Auth Settings dict for api client.
+
+ :return: The Auth Settings information dict.
+ """
+ auth = {}
+ if 'api_key' in self.api_key:
+ auth['api_key'] = {
+ 'type': 'api_key',
+ 'in': 'header',
+ 'key': 'api_key',
+ 'value': self.get_api_key_with_prefix(
+ 'api_key',
+ ),
+ }
+ if 'api_key_query' in self.api_key:
+ auth['api_key_query'] = {
+ 'type': 'api_key',
+ 'in': 'query',
+ 'key': 'api_key_query',
+ 'value': self.get_api_key_with_prefix(
+ 'api_key_query',
+ ),
+ }
+ if self.access_token is not None:
+ auth['bearer_test'] = {
+ 'type': 'bearer',
+ 'in': 'header',
+ 'format': 'JWT',
+ 'key': 'Authorization',
+ 'value': 'Bearer ' + self.access_token
+ }
+ if self.username is not None and self.password is not None:
+ auth['http_basic_test'] = {
+ 'type': 'basic',
+ 'in': 'header',
+ 'key': 'Authorization',
+ 'value': self.get_basic_auth_token()
+ }
+ if self.signing_info is not None:
+ auth['http_signature_test'] = {
+ 'type': 'http-signature',
+ 'in': 'header',
+ 'key': 'Authorization',
+ 'value': None # Signature headers are calculated for every HTTP request
+ }
+ if self.access_token is not None:
+ auth['petstore_auth'] = {
+ 'type': 'oauth2',
+ 'in': 'header',
+ 'key': 'Authorization',
+ 'value': 'Bearer ' + self.access_token
+ }
+ return auth
+
+ def to_debug_report(self):
+ """Gets the essential information for debugging.
+
+ :return: The report for debugging.
+ """
+ return "Python SDK Debug Report:\n"\
+ "OS: {env}\n"\
+ "Python Version: {pyversion}\n"\
+ "Version of the API: 1.0.0\n"\
+ "SDK Package Version: 1.0.0".\
+ format(env=sys.platform, pyversion=sys.version)
+
+ def get_host_settings(self):
+ """Gets an array of host settings
+
+ :return: An array of host settings
+ """
+ return [
+ {
+ 'url': "http://{server}.swagger.io:{port}/v2",
+ 'description': "petstore server",
+ 'variables': {
+ 'server': {
+ 'description': "No description provided",
+ 'default_value': "petstore",
+ 'enum_values': [
+ "petstore",
+ "qa-petstore",
+ "dev-petstore"
+ ]
+ },
+ 'port': {
+ 'description': "No description provided",
+ 'default_value': "80",
+ 'enum_values': [
+ "80",
+ "8080"
+ ]
+ }
+ }
+ },
+ {
+ 'url': "https://localhost:8080/{version}",
+ 'description': "The local server",
+ 'variables': {
+ 'version': {
+ 'description': "No description provided",
+ 'default_value': "v2",
+ 'enum_values': [
+ "v1",
+ "v2"
+ ]
+ }
+ }
+ },
+ {
+ 'url': "https://127.0.0.1/no_varaible",
+ 'description': "The local server without variables",
+ }
+ ]
+
+ def get_host_from_settings(self, index, variables=None, servers=None):
+ """Gets host URL based on the index and variables
+ :param index: array index of the host settings
+ :param variables: hash of variable and the corresponding value
+ :param servers: an array of host settings or None
+ :return: URL based on host settings
+ """
+ if index is None:
+ return self._base_path
+
+ variables = {} if variables is None else variables
+ servers = self.get_host_settings() if servers is None else servers
+
+ try:
+ server = servers[index]
+ except IndexError:
+ raise ValueError(
+ "Invalid index {0} when selecting the host settings. "
+ "Must be less than {1}".format(index, len(servers)))
+
+ url = server['url']
+
+ # go through variables and replace placeholders
+ for variable_name, variable in server.get('variables', {}).items():
+ used_value = variables.get(
+ variable_name, variable['default_value'])
+
+ if 'enum_values' in variable \
+ and used_value not in variable['enum_values']:
+ raise ValueError(
+ "The variable `{0}` in the host URL has invalid value "
+ "{1}. Must be {2}.".format(
+ variable_name, variables[variable_name],
+ variable['enum_values']))
+
+ url = url.replace("{" + variable_name + "}", used_value)
+
+ return url
+
+ @property
+ def host(self):
+ """Return generated host."""
+ return self.get_host_from_settings(self.server_index, variables=self.server_variables)
+
+ @host.setter
+ def host(self, value):
+ """Fix base path."""
+ self._base_path = value
+ self.server_index = None
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/exceptions.py
new file mode 100644
index 00000000000..b81fd7505ff
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/exceptions.py
@@ -0,0 +1,160 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+class OpenApiException(Exception):
+ """The base exception class for all OpenAPIExceptions"""
+
+
+class ApiTypeError(OpenApiException, TypeError):
+ def __init__(self, msg, path_to_item=None, valid_classes=None,
+ key_type=None):
+ """ Raises an exception for TypeErrors
+
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (list): a list of keys an indices to get to the
+ current_item
+ None if unset
+ valid_classes (tuple): the primitive classes that current item
+ should be an instance of
+ None if unset
+ key_type (bool): False if our value is a value in a dict
+ True if it is a key in a dict
+ False if our item is an item in a list
+ None if unset
+ """
+ self.path_to_item = path_to_item
+ self.valid_classes = valid_classes
+ self.key_type = key_type
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiTypeError, self).__init__(full_msg)
+
+
+class ApiValueError(OpenApiException, ValueError):
+ def __init__(self, msg, path_to_item=None):
+ """
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (list) the path to the exception in the
+ received_data dict. None if unset
+ """
+
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiValueError, self).__init__(full_msg)
+
+
+class ApiAttributeError(OpenApiException, AttributeError):
+ def __init__(self, msg, path_to_item=None):
+ """
+ Raised when an attribute reference or assignment fails.
+
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (None/list) the path to the exception in the
+ received_data dict
+ """
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiAttributeError, self).__init__(full_msg)
+
+
+class ApiKeyError(OpenApiException, KeyError):
+ def __init__(self, msg, path_to_item=None):
+ """
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (None/list) the path to the exception in the
+ received_data dict
+ """
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiKeyError, self).__init__(full_msg)
+
+
+class ApiException(OpenApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ if http_resp:
+ self.status = http_resp.status
+ self.reason = http_resp.reason
+ self.body = http_resp.data
+ self.headers = http_resp.getheaders()
+ else:
+ self.status = status
+ self.reason = reason
+ self.body = None
+ self.headers = None
+
+ def __str__(self):
+ """Custom error messages for exception"""
+ error_message = "({0})\n"\
+ "Reason: {1}\n".format(self.status, self.reason)
+ if self.headers:
+ error_message += "HTTP response headers: {0}\n".format(
+ self.headers)
+
+ if self.body:
+ error_message += "HTTP response body: {0}\n".format(self.body)
+
+ return error_message
+
+
+class NotFoundException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(NotFoundException, self).__init__(status, reason, http_resp)
+
+
+class UnauthorizedException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(UnauthorizedException, self).__init__(status, reason, http_resp)
+
+
+class ForbiddenException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(ForbiddenException, self).__init__(status, reason, http_resp)
+
+
+class ServiceException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(ServiceException, self).__init__(status, reason, http_resp)
+
+
+def render_path(path_to_item):
+ """Returns a string representation of a path"""
+ result = ""
+ for pth in path_to_item:
+ if isinstance(pth, int):
+ result += "[{0}]".format(pth)
+ else:
+ result += "['{0}']".format(pth)
+ return result
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/__init__.py
new file mode 100644
index 00000000000..b2660c977b9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/__init__.py
@@ -0,0 +1,72 @@
+# coding: utf-8
+
+# flake8: noqa
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+# import models into model package
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
+from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
+from petstore_api.models.animal import Animal
+from petstore_api.models.any_of_pig import AnyOfPig
+from petstore_api.models.api_response import ApiResponse
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
+from petstore_api.models.array_test import ArrayTest
+from petstore_api.models.basque_pig import BasquePig
+from petstore_api.models.capitalization import Capitalization
+from petstore_api.models.cat import Cat
+from petstore_api.models.cat_all_of import CatAllOf
+from petstore_api.models.category import Category
+from petstore_api.models.class_model import ClassModel
+from petstore_api.models.client import Client
+from petstore_api.models.danish_pig import DanishPig
+from petstore_api.models.deprecated_object import DeprecatedObject
+from petstore_api.models.dog import Dog
+from petstore_api.models.dog_all_of import DogAllOf
+from petstore_api.models.dummy_model import DummyModel
+from petstore_api.models.enum_arrays import EnumArrays
+from petstore_api.models.enum_class import EnumClass
+from petstore_api.models.enum_test import EnumTest
+from petstore_api.models.file import File
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+from petstore_api.models.foo import Foo
+from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
+from petstore_api.models.format_test import FormatTest
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly
+from petstore_api.models.health_check_result import HealthCheckResult
+from petstore_api.models.list import List
+from petstore_api.models.map_test import MapTest
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+from petstore_api.models.model200_response import Model200Response
+from petstore_api.models.model_return import ModelReturn
+from petstore_api.models.name import Name
+from petstore_api.models.nullable_class import NullableClass
+from petstore_api.models.number_only import NumberOnly
+from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields
+from petstore_api.models.order import Order
+from petstore_api.models.outer_composite import OuterComposite
+from petstore_api.models.outer_enum import OuterEnum
+from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue
+from petstore_api.models.outer_enum_integer import OuterEnumInteger
+from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
+from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
+from petstore_api.models.pet import Pet
+from petstore_api.models.pig import Pig
+from petstore_api.models.read_only_first import ReadOnlyFirst
+from petstore_api.models.self_reference_model import SelfReferenceModel
+from petstore_api.models.single_ref_type import SingleRefType
+from petstore_api.models.special_model_name import SpecialModelName
+from petstore_api.models.special_name import SpecialName
+from petstore_api.models.tag import Tag
+from petstore_api.models.user import User
+from petstore_api.models.with_nested_one_of import WithNestedOneOf
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/additional_properties_class.py
new file mode 100644
index 00000000000..77d3e3ed178
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/additional_properties_class.py
@@ -0,0 +1,72 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Dict, Optional
+from pydantic import BaseModel, StrictStr
+
+class AdditionalPropertiesClass(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ map_property: Optional[Dict[str, StrictStr]] = None
+ map_of_map_property: Optional[Dict[str, Dict[str, StrictStr]]] = None
+ __properties = ["map_property", "map_of_map_property"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> AdditionalPropertiesClass:
+ """Create an instance of AdditionalPropertiesClass from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> AdditionalPropertiesClass:
+ """Create an instance of AdditionalPropertiesClass from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return AdditionalPropertiesClass.parse_obj(obj)
+
+ _obj = AdditionalPropertiesClass.parse_obj({
+ "map_property": obj.get("map_property"),
+ "map_of_map_property": obj.get("map_of_map_property")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/all_of_with_single_ref.py
new file mode 100644
index 00000000000..876a78a8f96
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/all_of_with_single_ref.py
@@ -0,0 +1,75 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class AllOfWithSingleRef(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ username: Optional[StrictStr] = None
+ single_ref_type: Optional[Any] = Field(None, alias="SingleRefType")
+ __properties = ["username", "SingleRefType"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> AllOfWithSingleRef:
+ """Create an instance of AllOfWithSingleRef from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of single_ref_type
+ if self.single_ref_type:
+ _dict['SingleRefType'] = self.single_ref_type.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> AllOfWithSingleRef:
+ """Create an instance of AllOfWithSingleRef from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return AllOfWithSingleRef.parse_obj(obj)
+
+ _obj = AllOfWithSingleRef.parse_obj({
+ "username": obj.get("username"),
+ "single_ref_type": SingleRefType.from_dict(obj.get("SingleRefType")) if obj.get("SingleRefType") is not None else None
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/animal.py
new file mode 100644
index 00000000000..582668b4f5f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/animal.py
@@ -0,0 +1,89 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+import petstore_api.models
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class Animal(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ class_name: StrictStr = Field(..., alias="className")
+ color: Optional[StrictStr] = 'red'
+ __properties = ["className", "color"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ # JSON field name that stores the object type
+ __discriminator_property_name = 'className'
+
+ # discriminator mappings
+ __discriminator_value_class_map = {
+ 'Cat': 'Cat',
+ 'Dog': 'Dog'
+ }
+
+ @classmethod
+ def get_discriminator_value(cls, obj: dict) -> str:
+ """Returns the discriminator value (object type) of the data"""
+ discriminator_value = obj[cls.__discriminator_property_name]
+ if discriminator_value:
+ return cls.__discriminator_value_class_map.get(discriminator_value)
+ else:
+ return None
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Union(Cat, Dog):
+ """Create an instance of Animal from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Union(Cat, Dog):
+ """Create an instance of Animal from a dict"""
+ # look up the object type based on discriminator mapping
+ object_type = cls.get_discriminator_value(obj)
+ if object_type:
+ klass = getattr(petstore_api.models, object_type)
+ return klass.from_dict(obj)
+ else:
+ raise ValueError("Animal failed to lookup discriminator value from " +
+ json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name +
+ ", mapping: " + json.dumps(cls.__discriminator_value_class_map))
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/any_of_pig.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/any_of_pig.py
new file mode 100644
index 00000000000..0841de93203
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/any_of_pig.py
@@ -0,0 +1,105 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr, ValidationError, validator
+from petstore_api.models.basque_pig import BasquePig
+from petstore_api.models.danish_pig import DanishPig
+from typing import Any, List
+from pydantic import StrictStr, Field
+
+ANYOFPIG_ANY_OF_SCHEMAS = ["BasquePig", "DanishPig"]
+
+class AnyOfPig(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ # data type: BasquePig
+ __anyof_schema_1: Optional[BasquePig] = None
+ # data type: DanishPig
+ __anyof_schema_2: Optional[DanishPig] = None
+ actual_instance: Any
+ any_of_schemas: List[str] = Field(ANYOFPIG_ANY_OF_SCHEMAS, const=True)
+
+ class Config:
+ validate_assignment = True
+
+ @validator('actual_instance')
+ def actual_instance_must_validate_anyof(cls, v):
+ error_messages = []
+ # validate data type: BasquePig
+ if type(v) is not BasquePig:
+ error_messages.append(f"Error! Input type `{type(v)}` is not `BasquePig`")
+ else:
+ return v
+
+ # validate data type: DanishPig
+ if type(v) is not DanishPig:
+ error_messages.append(f"Error! Input type `{type(v)}` is not `DanishPig`")
+ else:
+ return v
+
+ if error_messages:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into AnyOfPig with anyOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ else:
+ return v
+
+ @classmethod
+ def from_json(cls, json_str: str) -> AnyOfPig:
+ """Returns the object represented by the json string"""
+ instance = cls()
+ error_messages = []
+ # __anyof_schema_1: Optional[BasquePig] = None
+ try:
+ instance.actual_instance = BasquePig.from_json(json_str)
+ return instance
+ except ValidationError as e:
+ error_messages.append(str(e))
+ # __anyof_schema_2: Optional[DanishPig] = None
+ try:
+ instance.actual_instance = DanishPig.from_json(json_str)
+ return instance
+ except ValidationError as e:
+ error_messages.append(str(e))
+
+ if error_messages:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into AnyOfPig with anyOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is not None:
+ return self.actual_instance.to_json()
+ else:
+ return "null"
+
+ def to_dict(self) -> dict:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is not None:
+ return self.actual_instance.to_dict()
+ else:
+ return dict()
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.dict())
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/api_response.py
new file mode 100644
index 00000000000..8b6ca41d617
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/api_response.py
@@ -0,0 +1,74 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictInt, StrictStr
+
+class ApiResponse(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ code: Optional[StrictInt] = None
+ type: Optional[StrictStr] = None
+ message: Optional[StrictStr] = None
+ __properties = ["code", "type", "message"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ApiResponse:
+ """Create an instance of ApiResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ApiResponse:
+ """Create an instance of ApiResponse from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return ApiResponse.parse_obj(obj)
+
+ _obj = ApiResponse.parse_obj({
+ "code": obj.get("code"),
+ "type": obj.get("type"),
+ "message": obj.get("message")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_array_of_number_only.py
new file mode 100644
index 00000000000..bec2f93d230
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_array_of_number_only.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, Field, StrictFloat
+
+class ArrayOfArrayOfNumberOnly(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ array_array_number: Optional[List[List[StrictFloat]]] = Field(None, alias="ArrayArrayNumber")
+ __properties = ["ArrayArrayNumber"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ArrayOfArrayOfNumberOnly:
+ """Create an instance of ArrayOfArrayOfNumberOnly from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ArrayOfArrayOfNumberOnly:
+ """Create an instance of ArrayOfArrayOfNumberOnly from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return ArrayOfArrayOfNumberOnly.parse_obj(obj)
+
+ _obj = ArrayOfArrayOfNumberOnly.parse_obj({
+ "array_array_number": obj.get("ArrayArrayNumber")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_number_only.py
new file mode 100644
index 00000000000..779e5b17670
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_number_only.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, Field, StrictFloat
+
+class ArrayOfNumberOnly(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ array_number: Optional[List[StrictFloat]] = Field(None, alias="ArrayNumber")
+ __properties = ["ArrayNumber"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ArrayOfNumberOnly:
+ """Create an instance of ArrayOfNumberOnly from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ArrayOfNumberOnly:
+ """Create an instance of ArrayOfNumberOnly from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return ArrayOfNumberOnly.parse_obj(obj)
+
+ _obj = ArrayOfNumberOnly.parse_obj({
+ "array_number": obj.get("ArrayNumber")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_test.py
new file mode 100644
index 00000000000..6c640b42278
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_test.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, StrictInt, StrictStr
+from petstore_api.models.read_only_first import ReadOnlyFirst
+
+class ArrayTest(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ array_of_string: Optional[List[StrictStr]] = None
+ array_array_of_integer: Optional[List[List[StrictInt]]] = None
+ array_array_of_model: Optional[List[List[ReadOnlyFirst]]] = None
+ __properties = ["array_of_string", "array_array_of_integer", "array_array_of_model"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ArrayTest:
+ """Create an instance of ArrayTest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of each item in array_array_of_model (list)
+ _items = []
+ if self.array_array_of_model:
+ for _item in self.array_array_of_model:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict['array_array_of_model'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ArrayTest:
+ """Create an instance of ArrayTest from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return ArrayTest.parse_obj(obj)
+
+ _obj = ArrayTest.parse_obj({
+ "array_of_string": obj.get("array_of_string"),
+ "array_array_of_integer": obj.get("array_array_of_integer"),
+ "array_array_of_model": [List[ReadOnlyFirst].from_dict(_item) for _item in obj.get("array_array_of_model")] if obj.get("array_array_of_model") is not None else None
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/basque_pig.py
new file mode 100644
index 00000000000..18c8b241522
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/basque_pig.py
@@ -0,0 +1,72 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+
+from pydantic import BaseModel, Field, StrictStr
+
+class BasquePig(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ class_name: StrictStr = Field(..., alias="className")
+ color: StrictStr = ...
+ __properties = ["className", "color"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> BasquePig:
+ """Create an instance of BasquePig from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> BasquePig:
+ """Create an instance of BasquePig from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return BasquePig.parse_obj(obj)
+
+ _obj = BasquePig.parse_obj({
+ "class_name": obj.get("className"),
+ "color": obj.get("color")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/capitalization.py
new file mode 100644
index 00000000000..800d22c2360
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/capitalization.py
@@ -0,0 +1,80 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class Capitalization(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ small_camel: Optional[StrictStr] = Field(None, alias="smallCamel")
+ capital_camel: Optional[StrictStr] = Field(None, alias="CapitalCamel")
+ small_snake: Optional[StrictStr] = Field(None, alias="small_Snake")
+ capital_snake: Optional[StrictStr] = Field(None, alias="Capital_Snake")
+ sca_eth_flow_points: Optional[StrictStr] = Field(None, alias="SCA_ETH_Flow_Points")
+ att_name: Optional[StrictStr] = Field(None, alias="ATT_NAME", description="Name of the pet ")
+ __properties = ["smallCamel", "CapitalCamel", "small_Snake", "Capital_Snake", "SCA_ETH_Flow_Points", "ATT_NAME"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Capitalization:
+ """Create an instance of Capitalization from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Capitalization:
+ """Create an instance of Capitalization from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Capitalization.parse_obj(obj)
+
+ _obj = Capitalization.parse_obj({
+ "small_camel": obj.get("smallCamel"),
+ "capital_camel": obj.get("CapitalCamel"),
+ "small_snake": obj.get("small_Snake"),
+ "capital_snake": obj.get("Capital_Snake"),
+ "sca_eth_flow_points": obj.get("SCA_ETH_Flow_Points"),
+ "att_name": obj.get("ATT_NAME")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat.py
new file mode 100644
index 00000000000..c9070f52b9b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat.py
@@ -0,0 +1,73 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictBool
+from petstore_api.models.animal import Animal
+
+class Cat(Animal):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ declawed: Optional[StrictBool] = None
+ __properties = ["className", "color", "declawed"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Cat:
+ """Create an instance of Cat from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Cat:
+ """Create an instance of Cat from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Cat.parse_obj(obj)
+
+ _obj = Cat.parse_obj({
+ "class_name": obj.get("className"),
+ "color": obj.get("color") if obj.get("color") is not None else 'red',
+ "declawed": obj.get("declawed")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat_all_of.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat_all_of.py
new file mode 100644
index 00000000000..f6de765293b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat_all_of.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictBool
+
+class CatAllOf(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ declawed: Optional[StrictBool] = None
+ __properties = ["declawed"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> CatAllOf:
+ """Create an instance of CatAllOf from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> CatAllOf:
+ """Create an instance of CatAllOf from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return CatAllOf.parse_obj(obj)
+
+ _obj = CatAllOf.parse_obj({
+ "declawed": obj.get("declawed")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/category.py
new file mode 100644
index 00000000000..226caf6c360
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/category.py
@@ -0,0 +1,72 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictInt, StrictStr
+
+class Category(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ id: Optional[StrictInt] = None
+ name: StrictStr = ...
+ __properties = ["id", "name"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Category:
+ """Create an instance of Category from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Category:
+ """Create an instance of Category from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Category.parse_obj(obj)
+
+ _obj = Category.parse_obj({
+ "id": obj.get("id"),
+ "name": obj.get("name") if obj.get("name") is not None else 'default-name'
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/class_model.py
new file mode 100644
index 00000000000..5f40800b9c0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/class_model.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class ClassModel(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ var_class: Optional[StrictStr] = Field(None, alias="_class")
+ __properties = ["_class"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ClassModel:
+ """Create an instance of ClassModel from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ClassModel:
+ """Create an instance of ClassModel from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return ClassModel.parse_obj(obj)
+
+ _obj = ClassModel.parse_obj({
+ "var_class": obj.get("_class")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/client.py
new file mode 100644
index 00000000000..cc651168676
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/client.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+
+class Client(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ client: Optional[StrictStr] = None
+ __properties = ["client"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Client:
+ """Create an instance of Client from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Client:
+ """Create an instance of Client from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Client.parse_obj(obj)
+
+ _obj = Client.parse_obj({
+ "client": obj.get("client")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/danish_pig.py
new file mode 100644
index 00000000000..8dd221a3d3c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/danish_pig.py
@@ -0,0 +1,72 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+
+class DanishPig(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ class_name: StrictStr = Field(..., alias="className")
+ size: StrictInt = ...
+ __properties = ["className", "size"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DanishPig:
+ """Create an instance of DanishPig from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> DanishPig:
+ """Create an instance of DanishPig from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return DanishPig.parse_obj(obj)
+
+ _obj = DanishPig.parse_obj({
+ "class_name": obj.get("className"),
+ "size": obj.get("size")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/deprecated_object.py
new file mode 100644
index 00000000000..2d1ad0d9b7c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/deprecated_object.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+
+class DeprecatedObject(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ name: Optional[StrictStr] = None
+ __properties = ["name"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DeprecatedObject:
+ """Create an instance of DeprecatedObject from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> DeprecatedObject:
+ """Create an instance of DeprecatedObject from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return DeprecatedObject.parse_obj(obj)
+
+ _obj = DeprecatedObject.parse_obj({
+ "name": obj.get("name")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog.py
new file mode 100644
index 00000000000..11cc128ea9c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog.py
@@ -0,0 +1,73 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+from petstore_api.models.animal import Animal
+
+class Dog(Animal):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ breed: Optional[StrictStr] = None
+ __properties = ["className", "color", "breed"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Dog:
+ """Create an instance of Dog from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Dog:
+ """Create an instance of Dog from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Dog.parse_obj(obj)
+
+ _obj = Dog.parse_obj({
+ "class_name": obj.get("className"),
+ "color": obj.get("color") if obj.get("color") is not None else 'red',
+ "breed": obj.get("breed")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog_all_of.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog_all_of.py
new file mode 100644
index 00000000000..8befb96f847
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog_all_of.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+
+class DogAllOf(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ breed: Optional[StrictStr] = None
+ __properties = ["breed"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DogAllOf:
+ """Create an instance of DogAllOf from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> DogAllOf:
+ """Create an instance of DogAllOf from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return DogAllOf.parse_obj(obj)
+
+ _obj = DogAllOf.parse_obj({
+ "breed": obj.get("breed")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dummy_model.py
new file mode 100644
index 00000000000..b91cc8103b6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dummy_model.py
@@ -0,0 +1,75 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+
+class DummyModel(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ category: Optional[StrictStr] = None
+ self_ref: Optional[SelfReferenceModel] = None
+ __properties = ["category", "self_ref"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DummyModel:
+ """Create an instance of DummyModel from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of self_ref
+ if self.self_ref:
+ _dict['self_ref'] = self.self_ref.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> DummyModel:
+ """Create an instance of DummyModel from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return DummyModel.parse_obj(obj)
+
+ _obj = DummyModel.parse_obj({
+ "category": obj.get("category"),
+ "self_ref": SelfReferenceModel.from_dict(obj.get("self_ref")) if obj.get("self_ref") is not None else None
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_arrays.py
new file mode 100644
index 00000000000..b172e327c9b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_arrays.py
@@ -0,0 +1,90 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, StrictStr, validator
+
+class EnumArrays(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ just_symbol: Optional[StrictStr] = None
+ array_enum: Optional[List[StrictStr]] = None
+ __properties = ["just_symbol", "array_enum"]
+
+ @validator('just_symbol')
+ def just_symbol_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in ('>=', '$'):
+ raise ValueError("must validate the enum values ('>=', '$')")
+ return v
+
+ @validator('array_enum')
+ def array_enum_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in ('fish', 'crab'):
+ raise ValueError("must validate the enum values ('fish', 'crab')")
+ return v
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> EnumArrays:
+ """Create an instance of EnumArrays from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> EnumArrays:
+ """Create an instance of EnumArrays from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return EnumArrays.parse_obj(obj)
+
+ _obj = EnumArrays.parse_obj({
+ "just_symbol": obj.get("just_symbol"),
+ "array_enum": obj.get("array_enum")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_class.py
new file mode 100644
index 00000000000..24336123fa3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_class.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class EnumClass(str, Enum):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ """
+ allowed enum values
+ """
+
+ ABC = '_abc'
+ EFG = '-efg'
+ XYZ = '(xyz)'
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_test.py
new file mode 100644
index 00000000000..6166ab6414d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_test.py
@@ -0,0 +1,125 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator
+from petstore_api.models.outer_enum import OuterEnum
+from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue
+from petstore_api.models.outer_enum_integer import OuterEnumInteger
+from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
+
+class EnumTest(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ enum_string: Optional[StrictStr] = None
+ enum_string_required: StrictStr = ...
+ enum_integer: Optional[StrictInt] = None
+ enum_number: Optional[StrictFloat] = None
+ outer_enum: Optional[OuterEnum] = Field(None, alias="outerEnum")
+ outer_enum_integer: Optional[OuterEnumInteger] = Field(None, alias="outerEnumInteger")
+ outer_enum_default_value: Optional[OuterEnumDefaultValue] = Field(None, alias="outerEnumDefaultValue")
+ outer_enum_integer_default_value: Optional[OuterEnumIntegerDefaultValue] = Field(None, alias="outerEnumIntegerDefaultValue")
+ __properties = ["enum_string", "enum_string_required", "enum_integer", "enum_number", "outerEnum", "outerEnumInteger", "outerEnumDefaultValue", "outerEnumIntegerDefaultValue"]
+
+ @validator('enum_string')
+ def enum_string_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in ('UPPER', 'lower', ''):
+ raise ValueError("must validate the enum values ('UPPER', 'lower', '')")
+ return v
+
+ @validator('enum_string_required')
+ def enum_string_required_validate_enum(cls, v):
+ if v not in ('UPPER', 'lower', ''):
+ raise ValueError("must validate the enum values ('UPPER', 'lower', '')")
+ return v
+
+ @validator('enum_integer')
+ def enum_integer_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in (1, -1):
+ raise ValueError("must validate the enum values (1, -1)")
+ return v
+
+ @validator('enum_number')
+ def enum_number_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in (1.1, -1.2):
+ raise ValueError("must validate the enum values (1.1, -1.2)")
+ return v
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> EnumTest:
+ """Create an instance of EnumTest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # set to None if outer_enum (nullable) is None
+ if self.outer_enum is None:
+ _dict['outerEnum'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> EnumTest:
+ """Create an instance of EnumTest from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return EnumTest.parse_obj(obj)
+
+ _obj = EnumTest.parse_obj({
+ "enum_string": obj.get("enum_string"),
+ "enum_string_required": obj.get("enum_string_required"),
+ "enum_integer": obj.get("enum_integer"),
+ "enum_number": obj.get("enum_number"),
+ "outer_enum": obj.get("outerEnum"),
+ "outer_enum_integer": obj.get("outerEnumInteger"),
+ "outer_enum_default_value": obj.get("outerEnumDefaultValue"),
+ "outer_enum_integer_default_value": obj.get("outerEnumIntegerDefaultValue")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file.py
new file mode 100644
index 00000000000..547ac02231c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class File(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ source_uri: Optional[StrictStr] = Field(None, alias="sourceURI", description="Test capitalization")
+ __properties = ["sourceURI"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> File:
+ """Create an instance of File from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> File:
+ """Create an instance of File from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return File.parse_obj(obj)
+
+ _obj = File.parse_obj({
+ "source_uri": obj.get("sourceURI")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file_schema_test_class.py
new file mode 100644
index 00000000000..0a10b607a55
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file_schema_test_class.py
@@ -0,0 +1,83 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel
+from petstore_api.models.file import File
+
+class FileSchemaTestClass(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ file: Optional[File] = None
+ files: Optional[List[File]] = None
+ __properties = ["file", "files"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> FileSchemaTestClass:
+ """Create an instance of FileSchemaTestClass from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of file
+ if self.file:
+ _dict['file'] = self.file.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of each item in files (list)
+ _items = []
+ if self.files:
+ for _item in self.files:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict['files'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> FileSchemaTestClass:
+ """Create an instance of FileSchemaTestClass from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return FileSchemaTestClass.parse_obj(obj)
+
+ _obj = FileSchemaTestClass.parse_obj({
+ "file": File.from_dict(obj.get("file")) if obj.get("file") is not None else None,
+ "files": [File.from_dict(_item) for _item in obj.get("files")] if obj.get("files") is not None else None
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo.py
new file mode 100644
index 00000000000..fdd55d3b587
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+
+class Foo(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ bar: Optional[StrictStr] = 'bar'
+ __properties = ["bar"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Foo:
+ """Create an instance of Foo from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Foo:
+ """Create an instance of Foo from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Foo.parse_obj(obj)
+
+ _obj = Foo.parse_obj({
+ "bar": obj.get("bar") if obj.get("bar") is not None else 'bar'
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo_get_default_response.py
new file mode 100644
index 00000000000..824cb819f96
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo_get_default_response.py
@@ -0,0 +1,74 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel
+from petstore_api.models.foo import Foo
+
+class FooGetDefaultResponse(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ string: Optional[Foo] = None
+ __properties = ["string"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> FooGetDefaultResponse:
+ """Create an instance of FooGetDefaultResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of string
+ if self.string:
+ _dict['string'] = self.string.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> FooGetDefaultResponse:
+ """Create an instance of FooGetDefaultResponse from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return FooGetDefaultResponse.parse_obj(obj)
+
+ _obj = FooGetDefaultResponse.parse_obj({
+ "string": Foo.from_dict(obj.get("string")) if obj.get("string") is not None else None
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/format_test.py
new file mode 100644
index 00000000000..f0801d5ec9d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/format_test.py
@@ -0,0 +1,118 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import date, datetime
+from typing import Optional
+from pydantic import BaseModel, Field, StrictBytes, StrictInt, StrictStr, condecimal, confloat, conint, constr, validator
+
+class FormatTest(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ integer: Optional[conint(strict=True, le=100, ge=10)] = None
+ int32: Optional[conint(strict=True, le=200, ge=20)] = None
+ int64: Optional[StrictInt] = None
+ number: confloat(strict=True, le=543.2, ge=32.1) = ...
+ float: Optional[confloat(strict=True, le=987.6, ge=54.3)] = None
+ double: Optional[confloat(strict=True, le=123.4, ge=67.8)] = None
+ decimal: Optional[condecimal()] = None
+ string: Optional[constr(strict=True)] = None
+ byte: StrictBytes = ...
+ binary: Optional[StrictBytes] = None
+ var_date: date = Field(..., alias="date")
+ date_time: Optional[datetime] = Field(None, alias="dateTime")
+ uuid: Optional[StrictStr] = None
+ password: constr(strict=True, max_length=64, min_length=10) = ...
+ pattern_with_digits: Optional[constr(strict=True)] = Field(None, description="A string that is a 10 digit number. Can have leading zeros.")
+ pattern_with_digits_and_delimiter: Optional[constr(strict=True)] = Field(None, description="A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.")
+ __properties = ["integer", "int32", "int64", "number", "float", "double", "decimal", "string", "byte", "binary", "date", "dateTime", "uuid", "password", "pattern_with_digits", "pattern_with_digits_and_delimiter"]
+
+ @validator('string')
+ def string_validate_regular_expression(cls, v):
+ if not re.match(r"[a-z]", v ,re.IGNORECASE):
+ raise ValueError(r"must validate the regular expression /[a-z]/i")
+ return v
+
+ @validator('pattern_with_digits')
+ def pattern_with_digits_validate_regular_expression(cls, v):
+ if not re.match(r"^\d{10}$", v):
+ raise ValueError(r"must validate the regular expression /^\d{10}$/")
+ return v
+
+ @validator('pattern_with_digits_and_delimiter')
+ def pattern_with_digits_and_delimiter_validate_regular_expression(cls, v):
+ if not re.match(r"^image_\d{1,3}$", v ,re.IGNORECASE):
+ raise ValueError(r"must validate the regular expression /^image_\d{1,3}$/i")
+ return v
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> FormatTest:
+ """Create an instance of FormatTest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> FormatTest:
+ """Create an instance of FormatTest from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return FormatTest.parse_obj(obj)
+
+ _obj = FormatTest.parse_obj({
+ "integer": obj.get("integer"),
+ "int32": obj.get("int32"),
+ "int64": obj.get("int64"),
+ "number": obj.get("number"),
+ "float": obj.get("float"),
+ "double": obj.get("double"),
+ "decimal": obj.get("decimal"),
+ "string": obj.get("string"),
+ "byte": obj.get("byte"),
+ "binary": obj.get("binary"),
+ "var_date": obj.get("date"),
+ "date_time": obj.get("dateTime"),
+ "uuid": obj.get("uuid"),
+ "password": obj.get("password"),
+ "pattern_with_digits": obj.get("pattern_with_digits"),
+ "pattern_with_digits_and_delimiter": obj.get("pattern_with_digits_and_delimiter")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/has_only_read_only.py
new file mode 100644
index 00000000000..a894bea69c5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/has_only_read_only.py
@@ -0,0 +1,74 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+
+class HasOnlyReadOnly(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ bar: Optional[StrictStr] = None
+ foo: Optional[StrictStr] = None
+ __properties = ["bar", "foo"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> HasOnlyReadOnly:
+ """Create an instance of HasOnlyReadOnly from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "bar",
+ "foo",
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> HasOnlyReadOnly:
+ """Create an instance of HasOnlyReadOnly from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return HasOnlyReadOnly.parse_obj(obj)
+
+ _obj = HasOnlyReadOnly.parse_obj({
+ "bar": obj.get("bar"),
+ "foo": obj.get("foo")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/health_check_result.py
new file mode 100644
index 00000000000..4894db223db
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/health_check_result.py
@@ -0,0 +1,74 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class HealthCheckResult(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ nullable_message: Optional[StrictStr] = Field(None, alias="NullableMessage")
+ __properties = ["NullableMessage"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> HealthCheckResult:
+ """Create an instance of HealthCheckResult from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # set to None if nullable_message (nullable) is None
+ if self.nullable_message is None:
+ _dict['NullableMessage'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> HealthCheckResult:
+ """Create an instance of HealthCheckResult from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return HealthCheckResult.parse_obj(obj)
+
+ _obj = HealthCheckResult.parse_obj({
+ "nullable_message": obj.get("NullableMessage")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/list.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/list.py
new file mode 100644
index 00000000000..5e57dd7284a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/list.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class List(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ var_123_list: Optional[StrictStr] = Field(None, alias="123-list")
+ __properties = ["123-list"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> List:
+ """Create an instance of List from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> List:
+ """Create an instance of List from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return List.parse_obj(obj)
+
+ _obj = List.parse_obj({
+ "var_123_list": obj.get("123-list")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/map_test.py
new file mode 100644
index 00000000000..0f163673c83
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/map_test.py
@@ -0,0 +1,85 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Dict, Optional
+from pydantic import BaseModel, StrictBool, StrictStr, validator
+
+class MapTest(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ map_map_of_string: Optional[Dict[str, Dict[str, StrictStr]]] = None
+ map_of_enum_string: Optional[Dict[str, StrictStr]] = None
+ direct_map: Optional[Dict[str, StrictBool]] = None
+ indirect_map: Optional[Dict[str, StrictBool]] = None
+ __properties = ["map_map_of_string", "map_of_enum_string", "direct_map", "indirect_map"]
+
+ @validator('map_of_enum_string')
+ def map_of_enum_string_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in ('UPPER', 'lower'):
+ raise ValueError("must validate the enum values ('UPPER', 'lower')")
+ return v
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MapTest:
+ """Create an instance of MapTest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MapTest:
+ """Create an instance of MapTest from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return MapTest.parse_obj(obj)
+
+ _obj = MapTest.parse_obj({
+ "map_map_of_string": obj.get("map_map_of_string"),
+ "map_of_enum_string": obj.get("map_of_enum_string"),
+ "direct_map": obj.get("direct_map"),
+ "indirect_map": obj.get("indirect_map")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py
new file mode 100644
index 00000000000..63cecf94a3c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from petstore_api.models.animal import Animal
+
+class MixedPropertiesAndAdditionalPropertiesClass(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ uuid: Optional[StrictStr] = None
+ date_time: Optional[datetime] = Field(None, alias="dateTime")
+ map: Optional[Dict[str, Animal]] = None
+ __properties = ["uuid", "dateTime", "map"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MixedPropertiesAndAdditionalPropertiesClass:
+ """Create an instance of MixedPropertiesAndAdditionalPropertiesClass from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of each value in map (dict)
+ _field_dict = {}
+ if self.map:
+ for _key in self.map:
+ if self.map[_key]:
+ _field_dict[_key] = self.map[_key].to_dict()
+ _dict['map'] = _field_dict
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MixedPropertiesAndAdditionalPropertiesClass:
+ """Create an instance of MixedPropertiesAndAdditionalPropertiesClass from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return MixedPropertiesAndAdditionalPropertiesClass.parse_obj(obj)
+
+ _obj = MixedPropertiesAndAdditionalPropertiesClass.parse_obj({
+ "uuid": obj.get("uuid"),
+ "date_time": obj.get("dateTime"),
+ "map": dict((_k, Dict[str, Animal].from_dict(_v)) for _k, _v in obj.get("map").items())
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model200_response.py
new file mode 100644
index 00000000000..9e63ffc0f65
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model200_response.py
@@ -0,0 +1,72 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+
+class Model200Response(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ name: Optional[StrictInt] = None
+ var_class: Optional[StrictStr] = Field(None, alias="class")
+ __properties = ["name", "class"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Model200Response:
+ """Create an instance of Model200Response from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Model200Response:
+ """Create an instance of Model200Response from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Model200Response.parse_obj(obj)
+
+ _obj = Model200Response.parse_obj({
+ "name": obj.get("name"),
+ "var_class": obj.get("class")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model_return.py
new file mode 100644
index 00000000000..a7906692c6c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model_return.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictInt
+
+class ModelReturn(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ var_return: Optional[StrictInt] = Field(None, alias="return")
+ __properties = ["return"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ModelReturn:
+ """Create an instance of ModelReturn from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ModelReturn:
+ """Create an instance of ModelReturn from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return ModelReturn.parse_obj(obj)
+
+ _obj = ModelReturn.parse_obj({
+ "var_return": obj.get("return")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/name.py
new file mode 100644
index 00000000000..27f190d6fc3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/name.py
@@ -0,0 +1,78 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+
+class Name(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ name: StrictInt = ...
+ snake_case: Optional[StrictInt] = None
+ var_property: Optional[StrictStr] = Field(None, alias="property")
+ var_123_number: Optional[StrictInt] = Field(None, alias="123Number")
+ __properties = ["name", "snake_case", "property", "123Number"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Name:
+ """Create an instance of Name from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "snake_case",
+ "var_123_number",
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Name:
+ """Create an instance of Name from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Name.parse_obj(obj)
+
+ _obj = Name.parse_obj({
+ "name": obj.get("name"),
+ "snake_case": obj.get("snake_case"),
+ "var_property": obj.get("property"),
+ "var_123_number": obj.get("123Number")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/nullable_class.py
new file mode 100644
index 00000000000..449bb066f72
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/nullable_class.py
@@ -0,0 +1,138 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import date, datetime
+from typing import Any, Dict, List, Optional
+from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr
+
+class NullableClass(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ required_integer_prop: Optional[StrictInt] = ...
+ integer_prop: Optional[StrictInt] = None
+ number_prop: Optional[StrictFloat] = None
+ boolean_prop: Optional[StrictBool] = None
+ string_prop: Optional[StrictStr] = None
+ date_prop: Optional[date] = None
+ datetime_prop: Optional[datetime] = None
+ array_nullable_prop: Optional[List[Dict[str, Any]]] = None
+ array_and_items_nullable_prop: Optional[List[Dict[str, Any]]] = None
+ array_items_nullable: Optional[List[Dict[str, Any]]] = None
+ object_nullable_prop: Optional[Dict[str, Dict[str, Any]]] = None
+ object_and_items_nullable_prop: Optional[Dict[str, Dict[str, Any]]] = None
+ object_items_nullable: Optional[Dict[str, Dict[str, Any]]] = None
+ __properties = ["required_integer_prop", "integer_prop", "number_prop", "boolean_prop", "string_prop", "date_prop", "datetime_prop", "array_nullable_prop", "array_and_items_nullable_prop", "array_items_nullable", "object_nullable_prop", "object_and_items_nullable_prop", "object_items_nullable"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> NullableClass:
+ """Create an instance of NullableClass from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # set to None if required_integer_prop (nullable) is None
+ if self.required_integer_prop is None:
+ _dict['required_integer_prop'] = None
+
+ # set to None if integer_prop (nullable) is None
+ if self.integer_prop is None:
+ _dict['integer_prop'] = None
+
+ # set to None if number_prop (nullable) is None
+ if self.number_prop is None:
+ _dict['number_prop'] = None
+
+ # set to None if boolean_prop (nullable) is None
+ if self.boolean_prop is None:
+ _dict['boolean_prop'] = None
+
+ # set to None if string_prop (nullable) is None
+ if self.string_prop is None:
+ _dict['string_prop'] = None
+
+ # set to None if date_prop (nullable) is None
+ if self.date_prop is None:
+ _dict['date_prop'] = None
+
+ # set to None if datetime_prop (nullable) is None
+ if self.datetime_prop is None:
+ _dict['datetime_prop'] = None
+
+ # set to None if array_nullable_prop (nullable) is None
+ if self.array_nullable_prop is None:
+ _dict['array_nullable_prop'] = None
+
+ # set to None if array_and_items_nullable_prop (nullable) is None
+ if self.array_and_items_nullable_prop is None:
+ _dict['array_and_items_nullable_prop'] = None
+
+ # set to None if object_nullable_prop (nullable) is None
+ if self.object_nullable_prop is None:
+ _dict['object_nullable_prop'] = None
+
+ # set to None if object_and_items_nullable_prop (nullable) is None
+ if self.object_and_items_nullable_prop is None:
+ _dict['object_and_items_nullable_prop'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> NullableClass:
+ """Create an instance of NullableClass from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return NullableClass.parse_obj(obj)
+
+ _obj = NullableClass.parse_obj({
+ "required_integer_prop": obj.get("required_integer_prop"),
+ "integer_prop": obj.get("integer_prop"),
+ "number_prop": obj.get("number_prop"),
+ "boolean_prop": obj.get("boolean_prop"),
+ "string_prop": obj.get("string_prop"),
+ "date_prop": obj.get("date_prop"),
+ "datetime_prop": obj.get("datetime_prop"),
+ "array_nullable_prop": obj.get("array_nullable_prop"),
+ "array_and_items_nullable_prop": obj.get("array_and_items_nullable_prop"),
+ "array_items_nullable": obj.get("array_items_nullable"),
+ "object_nullable_prop": obj.get("object_nullable_prop"),
+ "object_and_items_nullable_prop": obj.get("object_and_items_nullable_prop"),
+ "object_items_nullable": obj.get("object_items_nullable")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/number_only.py
new file mode 100644
index 00000000000..978b8c3da62
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/number_only.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictFloat
+
+class NumberOnly(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ just_number: Optional[StrictFloat] = Field(None, alias="JustNumber")
+ __properties = ["JustNumber"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> NumberOnly:
+ """Create an instance of NumberOnly from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> NumberOnly:
+ """Create an instance of NumberOnly from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return NumberOnly.parse_obj(obj)
+
+ _obj = NumberOnly.parse_obj({
+ "just_number": obj.get("JustNumber")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/object_with_deprecated_fields.py
new file mode 100644
index 00000000000..6ec29e2c908
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/object_with_deprecated_fields.py
@@ -0,0 +1,80 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, Field, StrictFloat, StrictStr
+from petstore_api.models.deprecated_object import DeprecatedObject
+
+class ObjectWithDeprecatedFields(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ uuid: Optional[StrictStr] = None
+ id: Optional[StrictFloat] = None
+ deprecated_ref: Optional[DeprecatedObject] = Field(None, alias="deprecatedRef")
+ bars: Optional[List[StrictStr]] = None
+ __properties = ["uuid", "id", "deprecatedRef", "bars"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ObjectWithDeprecatedFields:
+ """Create an instance of ObjectWithDeprecatedFields from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of deprecated_ref
+ if self.deprecated_ref:
+ _dict['deprecatedRef'] = self.deprecated_ref.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ObjectWithDeprecatedFields:
+ """Create an instance of ObjectWithDeprecatedFields from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return ObjectWithDeprecatedFields.parse_obj(obj)
+
+ _obj = ObjectWithDeprecatedFields.parse_obj({
+ "uuid": obj.get("uuid"),
+ "id": obj.get("id"),
+ "deprecated_ref": DeprecatedObject.from_dict(obj.get("deprecatedRef")) if obj.get("deprecatedRef") is not None else None,
+ "bars": obj.get("bars")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/order.py
new file mode 100644
index 00000000000..7605ddaf569
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/order.py
@@ -0,0 +1,89 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Optional
+from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator
+
+class Order(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ id: Optional[StrictInt] = None
+ pet_id: Optional[StrictInt] = Field(None, alias="petId")
+ quantity: Optional[StrictInt] = None
+ ship_date: Optional[datetime] = Field(None, alias="shipDate")
+ status: Optional[StrictStr] = Field(None, description="Order Status")
+ complete: Optional[StrictBool] = False
+ __properties = ["id", "petId", "quantity", "shipDate", "status", "complete"]
+
+ @validator('status')
+ def status_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in ('placed', 'approved', 'delivered'):
+ raise ValueError("must validate the enum values ('placed', 'approved', 'delivered')")
+ return v
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Order:
+ """Create an instance of Order from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Order:
+ """Create an instance of Order from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Order.parse_obj(obj)
+
+ _obj = Order.parse_obj({
+ "id": obj.get("id"),
+ "pet_id": obj.get("petId"),
+ "quantity": obj.get("quantity"),
+ "ship_date": obj.get("shipDate"),
+ "status": obj.get("status"),
+ "complete": obj.get("complete") if obj.get("complete") is not None else False
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_composite.py
new file mode 100644
index 00000000000..70606abd65f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_composite.py
@@ -0,0 +1,74 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictBool, StrictFloat, StrictStr
+
+class OuterComposite(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ my_number: Optional[StrictFloat] = None
+ my_string: Optional[StrictStr] = None
+ my_boolean: Optional[StrictBool] = None
+ __properties = ["my_number", "my_string", "my_boolean"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> OuterComposite:
+ """Create an instance of OuterComposite from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> OuterComposite:
+ """Create an instance of OuterComposite from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return OuterComposite.parse_obj(obj)
+
+ _obj = OuterComposite.parse_obj({
+ "my_number": obj.get("my_number"),
+ "my_string": obj.get("my_string"),
+ "my_boolean": obj.get("my_boolean")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum.py
new file mode 100644
index 00000000000..179e822d35d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class OuterEnum(str, Enum):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ """
+ allowed enum values
+ """
+
+ PLACED = 'placed'
+ APPROVED = 'approved'
+ DELIVERED = 'delivered'
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_default_value.py
new file mode 100644
index 00000000000..4a93cbda580
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_default_value.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class OuterEnumDefaultValue(str, Enum):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ """
+ allowed enum values
+ """
+
+ PLACED = 'placed'
+ APPROVED = 'approved'
+ DELIVERED = 'delivered'
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_integer.py
new file mode 100644
index 00000000000..4a4347e3106
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_integer.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class OuterEnumInteger(int, Enum):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ """
+ allowed enum values
+ """
+
+ NUMBER_0 = 0
+ NUMBER_1 = 1
+ NUMBER_2 = 2
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_integer_default_value.py
new file mode 100644
index 00000000000..b0e86076d16
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_integer_default_value.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class OuterEnumIntegerDefaultValue(int, Enum):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ """
+ allowed enum values
+ """
+
+ NUMBER_0 = 0
+ NUMBER_1 = 1
+ NUMBER_2 = 2
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_object_with_enum_property.py
new file mode 100644
index 00000000000..c80429a190b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_object_with_enum_property.py
@@ -0,0 +1,78 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel
+from petstore_api.models.outer_enum import OuterEnum
+from petstore_api.models.outer_enum_integer import OuterEnumInteger
+
+class OuterObjectWithEnumProperty(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ str_value: Optional[OuterEnum] = None
+ value: OuterEnumInteger = ...
+ __properties = ["str_value", "value"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> OuterObjectWithEnumProperty:
+ """Create an instance of OuterObjectWithEnumProperty from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # set to None if str_value (nullable) is None
+ if self.str_value is None:
+ _dict['str_value'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> OuterObjectWithEnumProperty:
+ """Create an instance of OuterObjectWithEnumProperty from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return OuterObjectWithEnumProperty.parse_obj(obj)
+
+ _obj = OuterObjectWithEnumProperty.parse_obj({
+ "str_value": obj.get("str_value"),
+ "value": obj.get("value")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pet.py
new file mode 100644
index 00000000000..1a45ae2a81c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pet.py
@@ -0,0 +1,101 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr, validator
+from petstore_api.models.category import Category
+from petstore_api.models.tag import Tag
+
+class Pet(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ id: Optional[StrictInt] = None
+ category: Optional[Category] = None
+ name: StrictStr = ...
+ photo_urls: List[StrictStr] = Field(..., alias="photoUrls", unique_items=True)
+ tags: Optional[List[Tag]] = None
+ status: Optional[StrictStr] = Field(None, description="pet status in the store")
+ __properties = ["id", "category", "name", "photoUrls", "tags", "status"]
+
+ @validator('status')
+ def status_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in ('available', 'pending', 'sold'):
+ raise ValueError("must validate the enum values ('available', 'pending', 'sold')")
+ return v
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Pet:
+ """Create an instance of Pet from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of category
+ if self.category:
+ _dict['category'] = self.category.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of each item in tags (list)
+ _items = []
+ if self.tags:
+ for _item in self.tags:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict['tags'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Pet:
+ """Create an instance of Pet from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Pet.parse_obj(obj)
+
+ _obj = Pet.parse_obj({
+ "id": obj.get("id"),
+ "category": Category.from_dict(obj.get("category")) if obj.get("category") is not None else None,
+ "name": obj.get("name"),
+ "photo_urls": obj.get("photoUrls"),
+ "tags": [Tag.from_dict(_item) for _item in obj.get("tags")] if obj.get("tags") is not None else None,
+ "status": obj.get("status")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pig.py
new file mode 100644
index 00000000000..7e98106feae
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pig.py
@@ -0,0 +1,126 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import json
+import re # noqa: F401
+
+from typing import Any, List, Optional
+from pydantic import BaseModel, Field, StrictStr, ValidationError, validator
+from petstore_api.models.basque_pig import BasquePig
+from petstore_api.models.danish_pig import DanishPig
+from typing import Any, List
+from pydantic import StrictStr, Field
+
+PIG_ONE_OF_SCHEMAS = ["BasquePig", "DanishPig"]
+
+class Pig(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ # data type: BasquePig
+ __oneof_schema_1: Optional[BasquePig] = None
+ # data type: DanishPig
+ __oneof_schema_2: Optional[DanishPig] = None
+ actual_instance: Any
+ one_of_schemas: List[str] = Field(PIG_ONE_OF_SCHEMAS, const=True)
+
+ class Config:
+ validate_assignment = True
+
+ discriminator_value_class_map = {
+ }
+
+ @validator('actual_instance')
+ def actual_instance_must_validate_oneof(cls, v):
+ error_messages = []
+ match = 0
+ # validate data type: BasquePig
+ if type(v) is not BasquePig:
+ error_messages.append(f"Error! Input type `{type(v)}` is not `BasquePig`")
+ else:
+ match += 1
+
+ # validate data type: DanishPig
+ if type(v) is not DanishPig:
+ error_messages.append(f"Error! Input type `{type(v)}` is not `DanishPig`")
+ else:
+ match += 1
+
+ if match > 1:
+ # more than 1 match
+ raise ValueError("Multiple matches found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ elif match == 0:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ else:
+ return v
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Pig:
+ return cls.from_json(json.dumps(obj))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Pig:
+ """Returns the object represented by the json string"""
+ instance = cls()
+ error_messages = []
+ match = 0
+
+ # deserialize data into BasquePig
+ try:
+ instance.actual_instance = BasquePig.from_json(json_str)
+ match += 1
+ except ValidationError as e:
+ error_messages.append(str(e))
+ # deserialize data into DanishPig
+ try:
+ instance.actual_instance = DanishPig.from_json(json_str)
+ match += 1
+ except ValidationError as e:
+ error_messages.append(str(e))
+
+ if match > 1:
+ # more than 1 match
+ raise ValueError("Multiple matches found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ elif match == 0:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is not None:
+ return self.actual_instance.to_json()
+ else:
+ return "null"
+
+ def to_dict(self) -> dict:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is not None:
+ return self.actual_instance.to_dict()
+ else:
+ return dict()
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.dict())
+
+
+
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/read_only_first.py
new file mode 100644
index 00000000000..4f8ca3b6eca
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/read_only_first.py
@@ -0,0 +1,73 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+
+class ReadOnlyFirst(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ bar: Optional[StrictStr] = None
+ baz: Optional[StrictStr] = None
+ __properties = ["bar", "baz"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ReadOnlyFirst:
+ """Create an instance of ReadOnlyFirst from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "bar",
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ReadOnlyFirst:
+ """Create an instance of ReadOnlyFirst from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return ReadOnlyFirst.parse_obj(obj)
+
+ _obj = ReadOnlyFirst.parse_obj({
+ "bar": obj.get("bar"),
+ "baz": obj.get("baz")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/self_reference_model.py
new file mode 100644
index 00000000000..39692b911ea
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/self_reference_model.py
@@ -0,0 +1,75 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictInt
+
+class SelfReferenceModel(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ size: Optional[StrictInt] = None
+ nested: Optional[DummyModel] = None
+ __properties = ["size", "nested"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> SelfReferenceModel:
+ """Create an instance of SelfReferenceModel from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of nested
+ if self.nested:
+ _dict['nested'] = self.nested.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> SelfReferenceModel:
+ """Create an instance of SelfReferenceModel from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return SelfReferenceModel.parse_obj(obj)
+
+ _obj = SelfReferenceModel.parse_obj({
+ "size": obj.get("size"),
+ "nested": DummyModel.from_dict(obj.get("nested")) if obj.get("nested") is not None else None
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/single_ref_type.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/single_ref_type.py
new file mode 100644
index 00000000000..67ae5e41be3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/single_ref_type.py
@@ -0,0 +1,35 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class SingleRefType(str, Enum):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ """
+ allowed enum values
+ """
+
+ ADMIN = 'admin'
+ USER = 'user'
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_model_name.py
new file mode 100644
index 00000000000..f5f83a5f419
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_model_name.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictInt
+
+class SpecialModelName(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ special_property_name: Optional[StrictInt] = Field(None, alias="$special[property.name]")
+ __properties = ["$special[property.name]"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> SpecialModelName:
+ """Create an instance of SpecialModelName from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> SpecialModelName:
+ """Create an instance of SpecialModelName from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return SpecialModelName.parse_obj(obj)
+
+ _obj = SpecialModelName.parse_obj({
+ "special_property_name": obj.get("$special[property.name]")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_name.py
new file mode 100644
index 00000000000..42d107844e2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_name.py
@@ -0,0 +1,87 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr, validator
+from petstore_api.models.category import Category
+
+class SpecialName(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ var_property: Optional[StrictInt] = Field(None, alias="property")
+ var_async: Optional[Category] = Field(None, alias="async")
+ var_schema: Optional[StrictStr] = Field(None, alias="schema", description="pet status in the store")
+ __properties = ["property", "async", "schema"]
+
+ @validator('var_schema')
+ def var_schema_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in ('available', 'pending', 'sold'):
+ raise ValueError("must validate the enum values ('available', 'pending', 'sold')")
+ return v
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> SpecialName:
+ """Create an instance of SpecialName from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of var_async
+ if self.var_async:
+ _dict['async'] = self.var_async.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> SpecialName:
+ """Create an instance of SpecialName from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return SpecialName.parse_obj(obj)
+
+ _obj = SpecialName.parse_obj({
+ "var_property": obj.get("property"),
+ "var_async": Category.from_dict(obj.get("async")) if obj.get("async") is not None else None,
+ "var_schema": obj.get("schema")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/tag.py
new file mode 100644
index 00000000000..310b8429843
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/tag.py
@@ -0,0 +1,72 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictInt, StrictStr
+
+class Tag(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ id: Optional[StrictInt] = None
+ name: Optional[StrictStr] = None
+ __properties = ["id", "name"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Tag:
+ """Create an instance of Tag from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Tag:
+ """Create an instance of Tag from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Tag.parse_obj(obj)
+
+ _obj = Tag.parse_obj({
+ "id": obj.get("id"),
+ "name": obj.get("name")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/user.py
new file mode 100644
index 00000000000..65fd56849d1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/user.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+
+class User(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ id: Optional[StrictInt] = None
+ username: Optional[StrictStr] = None
+ first_name: Optional[StrictStr] = Field(None, alias="firstName")
+ last_name: Optional[StrictStr] = Field(None, alias="lastName")
+ email: Optional[StrictStr] = None
+ password: Optional[StrictStr] = None
+ phone: Optional[StrictStr] = None
+ user_status: Optional[StrictInt] = Field(None, alias="userStatus", description="User Status")
+ __properties = ["id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> User:
+ """Create an instance of User from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> User:
+ """Create an instance of User from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return User.parse_obj(obj)
+
+ _obj = User.parse_obj({
+ "id": obj.get("id"),
+ "username": obj.get("username"),
+ "first_name": obj.get("firstName"),
+ "last_name": obj.get("lastName"),
+ "email": obj.get("email"),
+ "password": obj.get("password"),
+ "phone": obj.get("phone"),
+ "user_status": obj.get("userStatus")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/with_nested_one_of.py
new file mode 100644
index 00000000000..1675a10bbfc
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/with_nested_one_of.py
@@ -0,0 +1,76 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictInt
+from petstore_api.models.pig import Pig
+
+class WithNestedOneOf(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ size: Optional[StrictInt] = None
+ nested_pig: Optional[Pig] = None
+ __properties = ["size", "nested_pig"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> WithNestedOneOf:
+ """Create an instance of WithNestedOneOf from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of nested_pig
+ if self.nested_pig:
+ _dict['nested_pig'] = self.nested_pig.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> WithNestedOneOf:
+ """Create an instance of WithNestedOneOf from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return WithNestedOneOf.parse_obj(obj)
+
+ _obj = WithNestedOneOf.parse_obj({
+ "size": obj.get("size"),
+ "nested_pig": Pig.from_dict(obj.get("nested_pig")) if obj.get("nested_pig") is not None else None
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/rest.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/rest.py
new file mode 100644
index 00000000000..c128a2588f4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/rest.py
@@ -0,0 +1,249 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+import io
+import json
+import logging
+import re
+import ssl
+
+import aiohttp
+from urllib.parse import urlencode, quote_plus
+
+from petstore_api.exceptions import ApiException, ApiValueError
+
+logger = logging.getLogger(__name__)
+
+
+class RESTResponse(io.IOBase):
+
+ def __init__(self, resp, data):
+ self.aiohttp_response = resp
+ self.status = resp.status
+ self.reason = resp.reason
+ self.data = data
+
+ def getheaders(self):
+ """Returns a CIMultiDictProxy of the response headers."""
+ return self.aiohttp_response.headers
+
+ def getheader(self, name, default=None):
+ """Returns a given response header."""
+ return self.aiohttp_response.headers.get(name, default)
+
+
+class RESTClientObject(object):
+
+ def __init__(self, configuration, pools_size=4, maxsize=None):
+
+ # maxsize is number of requests to host that are allowed in parallel
+ if maxsize is None:
+ maxsize = configuration.connection_pool_maxsize
+
+ ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert)
+ if configuration.cert_file:
+ ssl_context.load_cert_chain(
+ configuration.cert_file, keyfile=configuration.key_file
+ )
+
+ if not configuration.verify_ssl:
+ ssl_context.check_hostname = False
+ ssl_context.verify_mode = ssl.CERT_NONE
+
+ connector = aiohttp.TCPConnector(
+ limit=maxsize,
+ ssl=ssl_context
+ )
+
+ self.proxy = configuration.proxy
+ self.proxy_headers = configuration.proxy_headers
+
+ # https pool manager
+ self.pool_manager = aiohttp.ClientSession(
+ connector=connector,
+ trust_env=True
+ )
+
+ async def close(self):
+ await self.pool_manager.close()
+
+ async def request(self, method, url, query_params=None, headers=None,
+ body=None, post_params=None, _preload_content=True,
+ _request_timeout=None):
+ """Execute request
+
+ :param method: http request method
+ :param url: http request url
+ :param query_params: query parameters in the url
+ :param headers: http request headers
+ :param body: request json body, for `application/json`
+ :param post_params: request post parameters,
+ `application/x-www-form-urlencoded`
+ and `multipart/form-data`
+ :param _preload_content: this is a non-applicable field for
+ the AiohttpClient.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ """
+ method = method.upper()
+ assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
+ 'PATCH', 'OPTIONS']
+
+ if post_params and body:
+ raise ApiValueError(
+ "body parameter cannot be used with post_params parameter."
+ )
+
+ post_params = post_params or {}
+ headers = headers or {}
+ # url already contains the URL query string
+ # so reset query_params to empty dict
+ query_params = {}
+ timeout = _request_timeout or 5 * 60
+
+ if 'Content-Type' not in headers:
+ headers['Content-Type'] = 'application/json'
+
+ args = {
+ "method": method,
+ "url": url,
+ "timeout": timeout,
+ "headers": headers
+ }
+
+ if self.proxy:
+ args["proxy"] = self.proxy
+ if self.proxy_headers:
+ args["proxy_headers"] = self.proxy_headers
+
+ if query_params:
+ args["url"] += '?' + urlencode(query_params)
+
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
+ if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
+ if re.search('json', headers['Content-Type'], re.IGNORECASE):
+ if body is not None:
+ body = json.dumps(body)
+ args["data"] = body
+ elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
+ args["data"] = aiohttp.FormData(post_params)
+ elif headers['Content-Type'] == 'multipart/form-data':
+ # must del headers['Content-Type'], or the correct
+ # Content-Type which generated by aiohttp
+ del headers['Content-Type']
+ data = aiohttp.FormData()
+ for param in post_params:
+ k, v = param
+ if isinstance(v, tuple) and len(v) == 3:
+ data.add_field(k,
+ value=v[1],
+ filename=v[0],
+ content_type=v[2])
+ else:
+ data.add_field(k, v)
+ args["data"] = data
+
+ # Pass a `bytes` parameter directly in the body to support
+ # other content types than Json when `body` argument is provided
+ # in serialized form
+ elif isinstance(body, bytes):
+ args["data"] = body
+ else:
+ # Cannot generate the request from given parameters
+ msg = """Cannot prepare a request message for provided
+ arguments. Please check that your arguments match
+ declared content type."""
+ raise ApiException(status=0, reason=msg)
+
+ r = await self.pool_manager.request(**args)
+ if _preload_content:
+
+ data = await r.read()
+ r = RESTResponse(r, data)
+
+ # log response body
+ logger.debug("response body: %s", r.data)
+
+ if not 200 <= r.status <= 299:
+ raise ApiException(http_resp=r)
+
+ return r
+
+ async def get_request(self, url, headers=None, query_params=None,
+ _preload_content=True, _request_timeout=None):
+ return (await self.request("GET", url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params))
+
+ async def head_request(self, url, headers=None, query_params=None,
+ _preload_content=True, _request_timeout=None):
+ return (await self.request("HEAD", url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params))
+
+ async def options_request(self, url, headers=None, query_params=None,
+ post_params=None, body=None, _preload_content=True,
+ _request_timeout=None):
+ return (await self.request("OPTIONS", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body))
+
+ async def delete_request(self, url, headers=None, query_params=None, body=None,
+ _preload_content=True, _request_timeout=None):
+ return (await self.request("DELETE", url,
+ headers=headers,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body))
+
+ async def post_request(self, url, headers=None, query_params=None,
+ post_params=None, body=None, _preload_content=True,
+ _request_timeout=None):
+ return (await self.request("POST", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body))
+
+ async def put_request(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ return (await self.request("PUT", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body))
+
+ async def patch_request(self, url, headers=None, query_params=None,
+ post_params=None, body=None, _preload_content=True,
+ _request_timeout=None):
+ return (await self.request("PATCH", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body))
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/signing.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/signing.py
new file mode 100644
index 00000000000..5060f6edbcd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/signing.py
@@ -0,0 +1,416 @@
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from base64 import b64encode
+from Crypto.IO import PEM, PKCS8
+from Crypto.Hash import SHA256, SHA512
+from Crypto.PublicKey import RSA, ECC
+from Crypto.Signature import PKCS1_v1_5, pss, DSS
+from email.utils import formatdate
+import json
+import os
+import re
+from time import time
+from urllib.parse import urlencode, urlparse
+
+# The constants below define a subset of HTTP headers that can be included in the
+# HTTP signature scheme. Additional headers may be included in the signature.
+
+# The '(request-target)' header is a calculated field that includes the HTTP verb,
+# the URL path and the URL query.
+HEADER_REQUEST_TARGET = '(request-target)'
+# The time when the HTTP signature was generated.
+HEADER_CREATED = '(created)'
+# The time when the HTTP signature expires. The API server should reject HTTP requests
+# that have expired.
+HEADER_EXPIRES = '(expires)'
+# The 'Host' header.
+HEADER_HOST = 'Host'
+# The 'Date' header.
+HEADER_DATE = 'Date'
+# When the 'Digest' header is included in the HTTP signature, the client automatically
+# computes the digest of the HTTP request body, per RFC 3230.
+HEADER_DIGEST = 'Digest'
+# The 'Authorization' header is automatically generated by the client. It includes
+# the list of signed headers and a base64-encoded signature.
+HEADER_AUTHORIZATION = 'Authorization'
+
+# The constants below define the cryptographic schemes for the HTTP signature scheme.
+SCHEME_HS2019 = 'hs2019'
+SCHEME_RSA_SHA256 = 'rsa-sha256'
+SCHEME_RSA_SHA512 = 'rsa-sha512'
+
+# The constants below define the signature algorithms that can be used for the HTTP
+# signature scheme.
+ALGORITHM_RSASSA_PSS = 'RSASSA-PSS'
+ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5'
+
+ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3'
+ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979'
+ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = {
+ ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979
+}
+
+# The cryptographic hash algorithm for the message signature.
+HASH_SHA256 = 'sha256'
+HASH_SHA512 = 'sha512'
+
+
+class HttpSigningConfiguration(object):
+ """The configuration parameters for the HTTP signature security scheme.
+ The HTTP signature security scheme is used to sign HTTP requests with a private key
+ which is in possession of the API client.
+ An 'Authorization' header is calculated by creating a hash of select headers,
+ and optionally the body of the HTTP request, then signing the hash value using
+ a private key. The 'Authorization' header is added to outbound HTTP requests.
+
+ NOTE: This class is auto generated by OpenAPI Generator
+
+ Ref: https://openapi-generator.tech
+ Do not edit the class manually.
+
+ :param key_id: A string value specifying the identifier of the cryptographic key,
+ when signing HTTP requests.
+ :param signing_scheme: A string value specifying the signature scheme, when
+ signing HTTP requests.
+ Supported value are hs2019, rsa-sha256, rsa-sha512.
+ Avoid using rsa-sha256, rsa-sha512 as they are deprecated. These values are
+ available for server-side applications that only support the older
+ HTTP signature algorithms.
+ :param private_key_path: A string value specifying the path of the file containing
+ a private key. The private key is used to sign HTTP requests.
+ :param private_key_passphrase: A string value specifying the passphrase to decrypt
+ the private key.
+ :param signed_headers: A list of strings. Each value is the name of a HTTP header
+ that must be included in the HTTP signature calculation.
+ The two special signature headers '(request-target)' and '(created)' SHOULD be
+ included in SignedHeaders.
+ The '(created)' header expresses when the signature was created.
+ The '(request-target)' header is a concatenation of the lowercased :method, an
+ ASCII space, and the :path pseudo-headers.
+ When signed_headers is not specified, the client defaults to a single value,
+ '(created)', in the list of HTTP headers.
+ When SignedHeaders contains the 'Digest' value, the client performs the
+ following operations:
+ 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2.
+ 2. Set the 'Digest' header in the request body.
+ 3. Include the 'Digest' header and value in the HTTP signature.
+ :param signing_algorithm: A string value specifying the signature algorithm, when
+ signing HTTP requests.
+ Supported values are:
+ 1. For RSA keys: RSASSA-PSS, RSASSA-PKCS1-v1_5.
+ 2. For ECDSA keys: fips-186-3, deterministic-rfc6979.
+ If None, the signing algorithm is inferred from the private key.
+ The default signing algorithm for RSA keys is RSASSA-PSS.
+ The default signing algorithm for ECDSA keys is fips-186-3.
+ :param hash_algorithm: The hash algorithm for the signature. Supported values are
+ sha256 and sha512.
+ If the signing_scheme is rsa-sha256, the hash algorithm must be set
+ to None or sha256.
+ If the signing_scheme is rsa-sha512, the hash algorithm must be set
+ to None or sha512.
+ :param signature_max_validity: The signature max validity, expressed as
+ a datetime.timedelta value. It must be a positive value.
+ """
+ def __init__(self, key_id, signing_scheme, private_key_path,
+ private_key_passphrase=None,
+ signed_headers=None,
+ signing_algorithm=None,
+ hash_algorithm=None,
+ signature_max_validity=None):
+ self.key_id = key_id
+ if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}:
+ raise Exception("Unsupported security scheme: {0}".format(signing_scheme))
+ self.signing_scheme = signing_scheme
+ if not os.path.exists(private_key_path):
+ raise Exception("Private key file does not exist")
+ self.private_key_path = private_key_path
+ self.private_key_passphrase = private_key_passphrase
+ self.signing_algorithm = signing_algorithm
+ self.hash_algorithm = hash_algorithm
+ if signing_scheme == SCHEME_RSA_SHA256:
+ if self.hash_algorithm is None:
+ self.hash_algorithm = HASH_SHA256
+ elif self.hash_algorithm != HASH_SHA256:
+ raise Exception("Hash algorithm must be sha256 when security scheme is %s" %
+ SCHEME_RSA_SHA256)
+ elif signing_scheme == SCHEME_RSA_SHA512:
+ if self.hash_algorithm is None:
+ self.hash_algorithm = HASH_SHA512
+ elif self.hash_algorithm != HASH_SHA512:
+ raise Exception("Hash algorithm must be sha512 when security scheme is %s" %
+ SCHEME_RSA_SHA512)
+ elif signing_scheme == SCHEME_HS2019:
+ if self.hash_algorithm is None:
+ self.hash_algorithm = HASH_SHA256
+ elif self.hash_algorithm not in {HASH_SHA256, HASH_SHA512}:
+ raise Exception("Invalid hash algorithm")
+ if signature_max_validity is not None and signature_max_validity.total_seconds() < 0:
+ raise Exception("The signature max validity must be a positive value")
+ self.signature_max_validity = signature_max_validity
+ # If the user has not provided any signed_headers, the default must be set to '(created)',
+ # as specified in the 'HTTP signature' standard.
+ if signed_headers is None or len(signed_headers) == 0:
+ signed_headers = [HEADER_CREATED]
+ if self.signature_max_validity is None and HEADER_EXPIRES in signed_headers:
+ raise Exception(
+ "Signature max validity must be set when "
+ "'(expires)' signature parameter is specified")
+ if len(signed_headers) != len(set(signed_headers)):
+ raise Exception("Cannot have duplicates in the signed_headers parameter")
+ if HEADER_AUTHORIZATION in signed_headers:
+ raise Exception("'Authorization' header cannot be included in signed headers")
+ self.signed_headers = signed_headers
+ self.private_key = None
+ """The private key used to sign HTTP requests.
+ Initialized when the PEM-encoded private key is loaded from a file.
+ """
+ self.host = None
+ """The host name, optionally followed by a colon and TCP port number.
+ """
+ self._load_private_key()
+
+ def get_http_signature_headers(self, resource_path, method, headers, body, query_params):
+ """Create a cryptographic message signature for the HTTP request and add the signed headers.
+
+ :param resource_path : A string representation of the HTTP request resource path.
+ :param method: A string representation of the HTTP request method, e.g. GET, POST.
+ :param headers: A dict containing the HTTP request headers.
+ :param body: The object representing the HTTP request body.
+ :param query_params: A string representing the HTTP request query parameters.
+ :return: A dict of HTTP headers that must be added to the outbound HTTP request.
+ """
+ if method is None:
+ raise Exception("HTTP method must be set")
+ if resource_path is None:
+ raise Exception("Resource path must be set")
+
+ signed_headers_list, request_headers_dict = self._get_signed_header_info(
+ resource_path, method, headers, body, query_params)
+
+ header_items = [
+ "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list]
+ string_to_sign = "\n".join(header_items)
+
+ digest, digest_prefix = self._get_message_digest(string_to_sign.encode())
+ b64_signed_msg = self._sign_digest(digest)
+
+ request_headers_dict[HEADER_AUTHORIZATION] = self._get_authorization_header(
+ signed_headers_list, b64_signed_msg)
+
+ return request_headers_dict
+
+ def get_public_key(self):
+ """Returns the public key object associated with the private key.
+ """
+ pubkey = None
+ if isinstance(self.private_key, RSA.RsaKey):
+ pubkey = self.private_key.publickey()
+ elif isinstance(self.private_key, ECC.EccKey):
+ pubkey = self.private_key.public_key()
+ return pubkey
+
+ def _load_private_key(self):
+ """Load the private key used to sign HTTP requests.
+ The private key is used to sign HTTP requests as defined in
+ https://datatracker.ietf.org/doc/draft-cavage-http-signatures/.
+ """
+ if self.private_key is not None:
+ return
+ with open(self.private_key_path, 'r') as f:
+ pem_data = f.read()
+ # Verify PEM Pre-Encapsulation Boundary
+ r = re.compile(r"\s*-----BEGIN (.*)-----\s+")
+ m = r.match(pem_data)
+ if not m:
+ raise ValueError("Not a valid PEM pre boundary")
+ pem_header = m.group(1)
+ if pem_header == 'RSA PRIVATE KEY':
+ self.private_key = RSA.importKey(pem_data, self.private_key_passphrase)
+ elif pem_header == 'EC PRIVATE KEY':
+ self.private_key = ECC.import_key(pem_data, self.private_key_passphrase)
+ elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}:
+ # Key is in PKCS8 format, which is capable of holding many different
+ # types of private keys, not just EC keys.
+ (key_binary, pem_header, is_encrypted) = \
+ PEM.decode(pem_data, self.private_key_passphrase)
+ (oid, privkey, params) = \
+ PKCS8.unwrap(key_binary, passphrase=self.private_key_passphrase)
+ if oid == '1.2.840.10045.2.1':
+ self.private_key = ECC.import_key(pem_data, self.private_key_passphrase)
+ else:
+ raise Exception("Unsupported key: {0}. OID: {1}".format(pem_header, oid))
+ else:
+ raise Exception("Unsupported key: {0}".format(pem_header))
+ # Validate the specified signature algorithm is compatible with the private key.
+ if self.signing_algorithm is not None:
+ supported_algs = None
+ if isinstance(self.private_key, RSA.RsaKey):
+ supported_algs = {ALGORITHM_RSASSA_PSS, ALGORITHM_RSASSA_PKCS1v15}
+ elif isinstance(self.private_key, ECC.EccKey):
+ supported_algs = ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS
+ if supported_algs is not None and self.signing_algorithm not in supported_algs:
+ raise Exception(
+ "Signing algorithm {0} is not compatible with private key".format(
+ self.signing_algorithm))
+
+ def _get_signed_header_info(self, resource_path, method, headers, body, query_params):
+ """Build the HTTP headers (name, value) that need to be included in
+ the HTTP signature scheme.
+
+ :param resource_path : A string representation of the HTTP request resource path.
+ :param method: A string representation of the HTTP request method, e.g. GET, POST.
+ :param headers: A dict containing the HTTP request headers.
+ :param body: The object (e.g. a dict) representing the HTTP request body.
+ :param query_params: A string representing the HTTP request query parameters.
+ :return: A tuple containing two dict objects:
+ The first dict contains the HTTP headers that are used to calculate
+ the HTTP signature.
+ The second dict contains the HTTP headers that must be added to
+ the outbound HTTP request.
+ """
+
+ if body is None:
+ body = ''
+ else:
+ body = body.to_json()
+
+ # Build the '(request-target)' HTTP signature parameter.
+ target_host = urlparse(self.host).netloc
+ target_path = urlparse(self.host).path
+ request_target = method.lower() + " " + target_path + resource_path
+ if query_params:
+ request_target += "?" + urlencode(query_params)
+
+ # Get UNIX time, e.g. seconds since epoch, not including leap seconds.
+ now = time()
+ # Format date per RFC 7231 section-7.1.1.2. An example is:
+ # Date: Wed, 21 Oct 2015 07:28:00 GMT
+ cdate = formatdate(timeval=now, localtime=False, usegmt=True)
+ # The '(created)' value MUST be a Unix timestamp integer value.
+ # Subsecond precision is not supported.
+ created = int(now)
+ if self.signature_max_validity is not None:
+ expires = now + self.signature_max_validity.total_seconds()
+
+ signed_headers_list = []
+ request_headers_dict = {}
+ for hdr_key in self.signed_headers:
+ hdr_key = hdr_key.lower()
+ if hdr_key == HEADER_REQUEST_TARGET:
+ value = request_target
+ elif hdr_key == HEADER_CREATED:
+ value = '{0}'.format(created)
+ elif hdr_key == HEADER_EXPIRES:
+ value = '{0}'.format(expires)
+ elif hdr_key == HEADER_DATE.lower():
+ value = cdate
+ request_headers_dict[HEADER_DATE] = '{0}'.format(cdate)
+ elif hdr_key == HEADER_DIGEST.lower():
+ request_body = body.encode()
+ body_digest, digest_prefix = self._get_message_digest(request_body)
+ b64_body_digest = b64encode(body_digest.digest())
+ value = digest_prefix + b64_body_digest.decode('ascii')
+ request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format(
+ digest_prefix, b64_body_digest.decode('ascii'))
+ elif hdr_key == HEADER_HOST.lower():
+ value = target_host
+ request_headers_dict[HEADER_HOST] = '{0}'.format(target_host)
+ else:
+ value = next((v for k, v in headers.items() if k.lower() == hdr_key), None)
+ if value is None:
+ raise Exception(
+ "Cannot sign HTTP request. "
+ "Request does not contain the '{0}' header".format(hdr_key))
+ signed_headers_list.append((hdr_key, value))
+
+ return signed_headers_list, request_headers_dict
+
+ def _get_message_digest(self, data):
+ """Calculates and returns a cryptographic digest of a specified HTTP request.
+
+ :param data: The string representation of the date to be hashed with a cryptographic hash.
+ :return: A tuple of (digest, prefix).
+ The digest is a hashing object that contains the cryptographic digest of
+ the HTTP request.
+ The prefix is a string that identifies the cryptographic hash. It is used
+ to generate the 'Digest' header as specified in RFC 3230.
+ """
+ if self.hash_algorithm == HASH_SHA512:
+ digest = SHA512.new()
+ prefix = 'SHA-512='
+ elif self.hash_algorithm == HASH_SHA256:
+ digest = SHA256.new()
+ prefix = 'SHA-256='
+ else:
+ raise Exception("Unsupported hash algorithm: {0}".format(self.hash_algorithm))
+ digest.update(data)
+ return digest, prefix
+
+ def _sign_digest(self, digest):
+ """Signs a message digest with a private key specified in the signing_info.
+
+ :param digest: A hashing object that contains the cryptographic digest of the HTTP request.
+ :return: A base-64 string representing the cryptographic signature of the input digest.
+ """
+ sig_alg = self.signing_algorithm
+ if isinstance(self.private_key, RSA.RsaKey):
+ if sig_alg is None or sig_alg == ALGORITHM_RSASSA_PSS:
+ # RSASSA-PSS in Section 8.1 of RFC8017.
+ signature = pss.new(self.private_key).sign(digest)
+ elif sig_alg == ALGORITHM_RSASSA_PKCS1v15:
+ # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017.
+ signature = PKCS1_v1_5.new(self.private_key).sign(digest)
+ else:
+ raise Exception("Unsupported signature algorithm: {0}".format(sig_alg))
+ elif isinstance(self.private_key, ECC.EccKey):
+ if sig_alg is None:
+ sig_alg = ALGORITHM_ECDSA_MODE_FIPS_186_3
+ if sig_alg in ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS:
+ # draft-ietf-httpbis-message-signatures-00 does not specify the ECDSA encoding.
+ # Issue: https://github.com/w3c-ccg/http-signatures/issues/107
+ signature = DSS.new(key=self.private_key, mode=sig_alg,
+ encoding='der').sign(digest)
+ else:
+ raise Exception("Unsupported signature algorithm: {0}".format(sig_alg))
+ else:
+ raise Exception("Unsupported private key: {0}".format(type(self.private_key)))
+ return b64encode(signature)
+
+ def _get_authorization_header(self, signed_headers, signed_msg):
+ """Calculates and returns the value of the 'Authorization' header when signing HTTP requests.
+
+ :param signed_headers : A list of tuples. Each value is the name of a HTTP header that
+ must be included in the HTTP signature calculation.
+ :param signed_msg: A base-64 encoded string representation of the signature.
+ :return: The string value of the 'Authorization' header, representing the signature
+ of the HTTP request.
+ """
+ created_ts = None
+ expires_ts = None
+ for k, v in signed_headers:
+ if k == HEADER_CREATED:
+ created_ts = v
+ elif k == HEADER_EXPIRES:
+ expires_ts = v
+ lower_keys = [k.lower() for k, v in signed_headers]
+ headers_value = " ".join(lower_keys)
+
+ auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\",".format(
+ self.key_id, self.signing_scheme)
+ if created_ts is not None:
+ auth_str = auth_str + "created={0},".format(created_ts)
+ if expires_ts is not None:
+ auth_str = auth_str + "expires={0},".format(expires_ts)
+ auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format(
+ headers_value, signed_msg.decode('ascii'))
+
+ return auth_str
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/pom.xml b/samples/openapi3/client/petstore/python-nextgen-aiohttp/pom.xml
new file mode 100755
index 00000000000..56b9deb95e3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/pom.xml
@@ -0,0 +1,46 @@
+
+ 4.0.0
+ org.openapitools
+ PythonNextgenAioHttpPetstoreTests
+ pom
+ 1.0-SNAPSHOT
+ Python OpenAPI3 Petstore Client
+
+
+
+ maven-dependency-plugin
+
+
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 1.2.1
+
+
+ test
+ integration-test
+
+ exec
+
+
+ bash
+
+ test_python3.sh
+
+
+
+
+
+
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/requirements.txt b/samples/openapi3/client/petstore/python-nextgen-aiohttp/requirements.txt
new file mode 100644
index 00000000000..1365d507af1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/requirements.txt
@@ -0,0 +1,6 @@
+python_dateutil >= 2.5.3
+setuptools >= 21.0.0
+urllib3 >= 1.25.3
+pydantic >= 1.10.2
+aenum >= 3.1.11
+aiohttp >= 3.0.0
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/setup.cfg b/samples/openapi3/client/petstore/python-nextgen-aiohttp/setup.cfg
new file mode 100644
index 00000000000..11433ee875a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/setup.cfg
@@ -0,0 +1,2 @@
+[flake8]
+max-line-length=99
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/setup.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/setup.py
new file mode 100644
index 00000000000..881691d6f74
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/setup.py
@@ -0,0 +1,50 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from setuptools import setup, find_packages # noqa: H301
+
+# To install the library, run the following
+#
+# python setup.py install
+#
+# prerequisite: setuptools
+# http://pypi.python.org/pypi/setuptools
+NAME = "petstore-api"
+VERSION = "1.0.0"
+PYTHON_REQUIRES = ">=3.7"
+REQUIRES = [
+ "urllib3 >= 1.25.3",
+ "python-dateutil",
+ "aiohttp >= 3.0.0",
+ "pem>=19.3.0",
+ "pycryptodome>=3.9.0",
+ "pydantic",
+ "aenum"
+]
+
+setup(
+ name=NAME,
+ version=VERSION,
+ description="OpenAPI Petstore",
+ author="OpenAPI Generator community",
+ author_email="team@openapitools.org",
+ url="",
+ keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"],
+ install_requires=REQUIRES,
+ packages=find_packages(exclude=["test", "tests"]),
+ include_package_data=True,
+ license="Apache-2.0",
+ long_description_content_type='text/markdown',
+ long_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: \" \\ # noqa: E501
+ """
+)
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test-requirements.txt b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test-requirements.txt
new file mode 100644
index 00000000000..8fc452fe6ed
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test-requirements.txt
@@ -0,0 +1,4 @@
+pytest~=7.1.3
+pytest-cov>=2.8.1
+pytest-randomly>=3.12.0
+pycryptodome>=3.9.0
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/__init__.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_additional_properties_class.py
new file mode 100644
index 00000000000..77df2fe73c5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_additional_properties_class.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestAdditionalPropertiesClass(unittest.TestCase):
+ """AdditionalPropertiesClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test AdditionalPropertiesClass
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501
+ if include_optional :
+ return AdditionalPropertiesClass(
+ map_property = {
+ 'key' : ''
+ },
+ map_of_map_property = {
+ 'key' : {
+ 'key' : ''
+ }
+ }
+ )
+ else :
+ return AdditionalPropertiesClass(
+ )
+
+ def testAdditionalPropertiesClass(self):
+ """Test AdditionalPropertiesClass"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_all_of_with_single_ref.py
new file mode 100644
index 00000000000..bfc2b41286a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_all_of_with_single_ref.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestAllOfWithSingleRef(unittest.TestCase):
+ """AllOfWithSingleRef unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test AllOfWithSingleRef
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.all_of_with_single_ref.AllOfWithSingleRef() # noqa: E501
+ if include_optional :
+ return AllOfWithSingleRef(
+ username = '',
+ single_ref_type = None
+ )
+ else :
+ return AllOfWithSingleRef(
+ )
+
+ def testAllOfWithSingleRef(self):
+ """Test AllOfWithSingleRef"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_animal.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_animal.py
new file mode 100644
index 00000000000..52b23c72645
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_animal.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.animal import Animal # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestAnimal(unittest.TestCase):
+ """Animal unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Animal
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.animal.Animal() # noqa: E501
+ if include_optional :
+ return Animal(
+ class_name = '',
+ color = 'red'
+ )
+ else :
+ return Animal(
+ class_name = '',
+ )
+
+ def testAnimal(self):
+ """Test Animal"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_another_fake_api.py
new file mode 100644
index 00000000000..d95798cfc5a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_another_fake_api.py
@@ -0,0 +1,40 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestAnotherFakeApi(unittest.TestCase):
+ """AnotherFakeApi unit test stubs"""
+
+ def setUp(self):
+ self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_call_123_test_special_tags(self):
+ """Test case for call_123_test_special_tags
+
+ To test special tags # noqa: E501
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_any_of_pig.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_any_of_pig.py
new file mode 100644
index 00000000000..1c9efe4160f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_any_of_pig.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.any_of_pig import AnyOfPig # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestAnyOfPig(unittest.TestCase):
+ """AnyOfPig unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test AnyOfPig
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.any_of_pig.AnyOfPig() # noqa: E501
+ if include_optional :
+ return AnyOfPig(
+ class_name = '',
+ color = '',
+ size = 56
+ )
+ else :
+ return AnyOfPig(
+ class_name = '',
+ color = '',
+ size = 56,
+ )
+
+ def testAnyOfPig(self):
+ """Test AnyOfPig"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_api_response.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_api_response.py
new file mode 100644
index 00000000000..54871268a19
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_api_response.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.api_response import ApiResponse # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestApiResponse(unittest.TestCase):
+ """ApiResponse unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ApiResponse
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.api_response.ApiResponse() # noqa: E501
+ if include_optional :
+ return ApiResponse(
+ code = 56,
+ type = '',
+ message = ''
+ )
+ else :
+ return ApiResponse(
+ )
+
+ def testApiResponse(self):
+ """Test ApiResponse"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_array_of_array_of_number_only.py
new file mode 100644
index 00000000000..341841c4050
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_array_of_array_of_number_only.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
+ """ArrayOfArrayOfNumberOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ArrayOfArrayOfNumberOnly
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501
+ if include_optional :
+ return ArrayOfArrayOfNumberOnly(
+ array_array_number = [
+ [
+ 1.337
+ ]
+ ]
+ )
+ else :
+ return ArrayOfArrayOfNumberOnly(
+ )
+
+ def testArrayOfArrayOfNumberOnly(self):
+ """Test ArrayOfArrayOfNumberOnly"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_array_of_number_only.py
new file mode 100644
index 00000000000..cf27c8a8fd7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_array_of_number_only.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestArrayOfNumberOnly(unittest.TestCase):
+ """ArrayOfNumberOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ArrayOfNumberOnly
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501
+ if include_optional :
+ return ArrayOfNumberOnly(
+ array_number = [
+ 1.337
+ ]
+ )
+ else :
+ return ArrayOfNumberOnly(
+ )
+
+ def testArrayOfNumberOnly(self):
+ """Test ArrayOfNumberOnly"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_array_test.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_array_test.py
new file mode 100644
index 00000000000..c26470404d7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_array_test.py
@@ -0,0 +1,65 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.array_test import ArrayTest # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestArrayTest(unittest.TestCase):
+ """ArrayTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ArrayTest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.array_test.ArrayTest() # noqa: E501
+ if include_optional :
+ return ArrayTest(
+ array_of_string = [
+ ''
+ ],
+ array_array_of_integer = [
+ [
+ 56
+ ]
+ ],
+ array_array_of_model = [
+ [
+ petstore_api.models.read_only_first.ReadOnlyFirst(
+ bar = '',
+ baz = '', )
+ ]
+ ]
+ )
+ else :
+ return ArrayTest(
+ )
+
+ def testArrayTest(self):
+ """Test ArrayTest"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_basque_pig.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_basque_pig.py
new file mode 100644
index 00000000000..99eeb77f807
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_basque_pig.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.basque_pig import BasquePig # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestBasquePig(unittest.TestCase):
+ """BasquePig unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test BasquePig
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.basque_pig.BasquePig() # noqa: E501
+ if include_optional :
+ return BasquePig(
+ class_name = '',
+ color = ''
+ )
+ else :
+ return BasquePig(
+ class_name = '',
+ color = '',
+ )
+
+ def testBasquePig(self):
+ """Test BasquePig"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_capitalization.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_capitalization.py
new file mode 100644
index 00000000000..7a1b46e714c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_capitalization.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.capitalization import Capitalization # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestCapitalization(unittest.TestCase):
+ """Capitalization unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Capitalization
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.capitalization.Capitalization() # noqa: E501
+ if include_optional :
+ return Capitalization(
+ small_camel = '',
+ capital_camel = '',
+ small_snake = '',
+ capital_snake = '',
+ sca_eth_flow_points = '',
+ att_name = ''
+ )
+ else :
+ return Capitalization(
+ )
+
+ def testCapitalization(self):
+ """Test Capitalization"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_cat.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_cat.py
new file mode 100644
index 00000000000..03549dffe93
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_cat.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.cat import Cat # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestCat(unittest.TestCase):
+ """Cat unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Cat
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.cat.Cat() # noqa: E501
+ if include_optional :
+ return Cat(
+ declawed = True
+ )
+ else :
+ return Cat(
+ )
+
+ def testCat(self):
+ """Test Cat"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_cat_all_of.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_cat_all_of.py
new file mode 100644
index 00000000000..486600aeb13
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_cat_all_of.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.cat_all_of import CatAllOf # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestCatAllOf(unittest.TestCase):
+ """CatAllOf unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test CatAllOf
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.cat_all_of.CatAllOf() # noqa: E501
+ if include_optional :
+ return CatAllOf(
+ declawed = True
+ )
+ else :
+ return CatAllOf(
+ )
+
+ def testCatAllOf(self):
+ """Test CatAllOf"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_category.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_category.py
new file mode 100644
index 00000000000..14848fcebcd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_category.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.category import Category # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestCategory(unittest.TestCase):
+ """Category unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Category
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.category.Category() # noqa: E501
+ if include_optional :
+ return Category(
+ id = 56,
+ name = 'default-name'
+ )
+ else :
+ return Category(
+ name = 'default-name',
+ )
+
+ def testCategory(self):
+ """Test Category"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_class_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_class_model.py
new file mode 100644
index 00000000000..9e5190a81b7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_class_model.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.class_model import ClassModel # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestClassModel(unittest.TestCase):
+ """ClassModel unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ClassModel
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.class_model.ClassModel() # noqa: E501
+ if include_optional :
+ return ClassModel(
+ _class = ''
+ )
+ else :
+ return ClassModel(
+ )
+
+ def testClassModel(self):
+ """Test ClassModel"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_client.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_client.py
new file mode 100644
index 00000000000..9a9311d6e7e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_client.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.client import Client # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestClient(unittest.TestCase):
+ """Client unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Client
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.client.Client() # noqa: E501
+ if include_optional :
+ return Client(
+ client = ''
+ )
+ else :
+ return Client(
+ )
+
+ def testClient(self):
+ """Test Client"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_danish_pig.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_danish_pig.py
new file mode 100644
index 00000000000..0fee5e18d9b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_danish_pig.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.danish_pig import DanishPig # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestDanishPig(unittest.TestCase):
+ """DanishPig unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test DanishPig
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.danish_pig.DanishPig() # noqa: E501
+ if include_optional :
+ return DanishPig(
+ class_name = '',
+ size = 56
+ )
+ else :
+ return DanishPig(
+ class_name = '',
+ size = 56,
+ )
+
+ def testDanishPig(self):
+ """Test DanishPig"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_default_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_default_api.py
new file mode 100644
index 00000000000..50e7c57bd0b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_default_api.py
@@ -0,0 +1,39 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.api.default_api import DefaultApi # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestDefaultApi(unittest.TestCase):
+ """DefaultApi unit test stubs"""
+
+ def setUp(self):
+ self.api = petstore_api.api.default_api.DefaultApi() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_foo_get(self):
+ """Test case for foo_get
+
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_deprecated_object.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_deprecated_object.py
new file mode 100644
index 00000000000..e4a2982cc0d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_deprecated_object.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.deprecated_object import DeprecatedObject # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestDeprecatedObject(unittest.TestCase):
+ """DeprecatedObject unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test DeprecatedObject
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.deprecated_object.DeprecatedObject() # noqa: E501
+ if include_optional :
+ return DeprecatedObject(
+ name = ''
+ )
+ else :
+ return DeprecatedObject(
+ )
+
+ def testDeprecatedObject(self):
+ """Test DeprecatedObject"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_dog.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_dog.py
new file mode 100644
index 00000000000..797b34f2f79
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_dog.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.dog import Dog # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestDog(unittest.TestCase):
+ """Dog unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Dog
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.dog.Dog() # noqa: E501
+ if include_optional :
+ return Dog(
+ breed = ''
+ )
+ else :
+ return Dog(
+ )
+
+ def testDog(self):
+ """Test Dog"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_dog_all_of.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_dog_all_of.py
new file mode 100644
index 00000000000..02502f9ee26
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_dog_all_of.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.dog_all_of import DogAllOf # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestDogAllOf(unittest.TestCase):
+ """DogAllOf unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test DogAllOf
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.dog_all_of.DogAllOf() # noqa: E501
+ if include_optional :
+ return DogAllOf(
+ breed = ''
+ )
+ else :
+ return DogAllOf(
+ )
+
+ def testDogAllOf(self):
+ """Test DogAllOf"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_dummy_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_dummy_model.py
new file mode 100644
index 00000000000..d6562c58bc2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_dummy_model.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.dummy_model import DummyModel # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestDummyModel(unittest.TestCase):
+ """DummyModel unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test DummyModel
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `DummyModel`
+ """
+ model = petstore_api.models.dummy_model.DummyModel() # noqa: E501
+ if include_optional :
+ return DummyModel(
+ category = '',
+ self_ref = petstore_api.models.self_reference_model.Self-Reference-Model(
+ size = 56,
+ nested = petstore_api.models.dummy_model.Dummy-Model(
+ category = '', ), )
+ )
+ else :
+ return DummyModel(
+ )
+ """
+
+ def testDummyModel(self):
+ """Test DummyModel"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_enum_arrays.py
new file mode 100644
index 00000000000..52cc98601bc
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_enum_arrays.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.enum_arrays import EnumArrays # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestEnumArrays(unittest.TestCase):
+ """EnumArrays unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test EnumArrays
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501
+ if include_optional :
+ return EnumArrays(
+ just_symbol = '>=',
+ array_enum = [
+ 'fish'
+ ]
+ )
+ else :
+ return EnumArrays(
+ )
+
+ def testEnumArrays(self):
+ """Test EnumArrays"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_enum_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_enum_class.py
new file mode 100644
index 00000000000..9d7a81272cd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_enum_class.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.enum_class import EnumClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestEnumClass(unittest.TestCase):
+ """EnumClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testEnumClass(self):
+ """Test EnumClass"""
+ # inst = EnumClass()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_enum_test.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_enum_test.py
new file mode 100644
index 00000000000..2cdb478cd15
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_enum_test.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.enum_test import EnumTest # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestEnumTest(unittest.TestCase):
+ """EnumTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test EnumTest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.enum_test.EnumTest() # noqa: E501
+ if include_optional :
+ return EnumTest(
+ enum_string = 'UPPER',
+ enum_string_required = 'UPPER',
+ enum_integer = 1,
+ enum_number = 1.1
+ )
+ else :
+ return EnumTest(
+ enum_string_required = 'UPPER',
+ )
+
+ def testEnumTest(self):
+ """Test EnumTest"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_fake_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_fake_api.py
new file mode 100644
index 00000000000..f093a95d7d8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_fake_api.py
@@ -0,0 +1,136 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.api.fake_api import FakeApi # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestFakeApi(unittest.TestCase):
+ """FakeApi unit test stubs"""
+
+ def setUp(self):
+ self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_fake_health_get(self):
+ """Test case for fake_health_get
+
+ Health check endpoint # noqa: E501
+ """
+ pass
+
+ def test_fake_http_signature_test(self):
+ """Test case for fake_http_signature_test
+
+ test http signature authentication # noqa: E501
+ """
+ pass
+
+ def test_fake_outer_boolean_serialize(self):
+ """Test case for fake_outer_boolean_serialize
+
+ """
+ pass
+
+ def test_fake_outer_composite_serialize(self):
+ """Test case for fake_outer_composite_serialize
+
+ """
+ pass
+
+ def test_fake_outer_number_serialize(self):
+ """Test case for fake_outer_number_serialize
+
+ """
+ pass
+
+ def test_fake_outer_string_serialize(self):
+ """Test case for fake_outer_string_serialize
+
+ """
+ pass
+
+ def test_fake_property_enum_integer_serialize(self):
+ """Test case for fake_property_enum_integer_serialize
+
+ """
+ pass
+
+ def test_test_body_with_binary(self):
+ """Test case for test_body_with_binary
+
+ """
+ pass
+
+ def test_test_body_with_file_schema(self):
+ """Test case for test_body_with_file_schema
+
+ """
+ pass
+
+ def test_test_body_with_query_params(self):
+ """Test case for test_body_with_query_params
+
+ """
+ pass
+
+ def test_test_client_model(self):
+ """Test case for test_client_model
+
+ To test \"client\" model # noqa: E501
+ """
+ pass
+
+ def test_test_endpoint_parameters(self):
+ """Test case for test_endpoint_parameters
+
+ Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+ """
+ pass
+
+ def test_test_group_parameters(self):
+ """Test case for test_group_parameters
+
+ Fake endpoint to test group parameters (optional) # noqa: E501
+ """
+ pass
+
+ def test_test_inline_additional_properties(self):
+ """Test case for test_inline_additional_properties
+
+ test inline additionalProperties # noqa: E501
+ """
+ pass
+
+ def test_test_json_form_data(self):
+ """Test case for test_json_form_data
+
+ test json serialization of form data # noqa: E501
+ """
+ pass
+
+ def test_test_query_parameter_collection_format(self):
+ """Test case for test_query_parameter_collection_format
+
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_fake_classname_tags123_api.py
new file mode 100644
index 00000000000..77de8cafee2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_fake_classname_tags123_api.py
@@ -0,0 +1,40 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestFakeClassnameTags123Api(unittest.TestCase):
+ """FakeClassnameTags123Api unit test stubs"""
+
+ def setUp(self):
+ self.api = petstore_api.api.fake_classname_tags123_api.FakeClassnameTags123Api() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_test_classname(self):
+ """Test case for test_classname
+
+ To test class name in snake case # noqa: E501
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_file.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_file.py
new file mode 100644
index 00000000000..260624562e4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_file.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.file import File # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFile(unittest.TestCase):
+ """File unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test File
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.file.File() # noqa: E501
+ if include_optional :
+ return File(
+ source_uri = ''
+ )
+ else :
+ return File(
+ )
+
+ def testFile(self):
+ """Test File"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_file_schema_test_class.py
new file mode 100644
index 00000000000..ef13e799336
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_file_schema_test_class.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFileSchemaTestClass(unittest.TestCase):
+ """FileSchemaTestClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test FileSchemaTestClass
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501
+ if include_optional :
+ return FileSchemaTestClass(
+ file = petstore_api.models.file.File(
+ source_uri = '', ),
+ files = [
+ petstore_api.models.file.File(
+ source_uri = '', )
+ ]
+ )
+ else :
+ return FileSchemaTestClass(
+ )
+
+ def testFileSchemaTestClass(self):
+ """Test FileSchemaTestClass"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_foo.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_foo.py
new file mode 100644
index 00000000000..9dcc9c2e3f4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_foo.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.foo import Foo # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFoo(unittest.TestCase):
+ """Foo unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Foo
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.foo.Foo() # noqa: E501
+ if include_optional :
+ return Foo(
+ bar = 'bar'
+ )
+ else :
+ return Foo(
+ )
+
+ def testFoo(self):
+ """Test Foo"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_foo_get_default_response.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_foo_get_default_response.py
new file mode 100644
index 00000000000..b517c9b4583
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_foo_get_default_response.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.foo_get_default_response import FooGetDefaultResponse # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFooGetDefaultResponse(unittest.TestCase):
+ """FooGetDefaultResponse unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test FooGetDefaultResponse
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.foo_get_default_response.FooGetDefaultResponse() # noqa: E501
+ if include_optional :
+ return FooGetDefaultResponse(
+ string = petstore_api.models.foo.Foo(
+ bar = 'bar', )
+ )
+ else :
+ return FooGetDefaultResponse(
+ )
+
+ def testFooGetDefaultResponse(self):
+ """Test FooGetDefaultResponse"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_format_test.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_format_test.py
new file mode 100644
index 00000000000..0426b9ce8d0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_format_test.py
@@ -0,0 +1,69 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.format_test import FormatTest # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFormatTest(unittest.TestCase):
+ """FormatTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test FormatTest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.format_test.FormatTest() # noqa: E501
+ if include_optional :
+ return FormatTest(
+ integer = 10,
+ int32 = 20,
+ int64 = 56,
+ number = 32.1,
+ float = 54.3,
+ double = 67.8,
+ string = 'a',
+ byte = 'YQ==',
+ binary = bytes(b'blah'),
+ _date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
+ date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ uuid = '72f98069-206d-4f12-9f12-3d1e525a8e84',
+ password = '0123456789',
+ pattern_with_digits = '0480728880',
+ pattern_with_digits_and_delimiter = 'image_480'
+ )
+ else :
+ return FormatTest(
+ number = 32.1,
+ byte = 'YQ==',
+ _date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
+ password = '0123456789',
+ )
+
+ def testFormatTest(self):
+ """Test FormatTest"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_has_only_read_only.py
new file mode 100644
index 00000000000..93a604cc315
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_has_only_read_only.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestHasOnlyReadOnly(unittest.TestCase):
+ """HasOnlyReadOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test HasOnlyReadOnly
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501
+ if include_optional :
+ return HasOnlyReadOnly(
+ bar = '',
+ foo = ''
+ )
+ else :
+ return HasOnlyReadOnly(
+ )
+
+ def testHasOnlyReadOnly(self):
+ """Test HasOnlyReadOnly"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_health_check_result.py
new file mode 100644
index 00000000000..e2a7fbcfbaf
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_health_check_result.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.health_check_result import HealthCheckResult # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestHealthCheckResult(unittest.TestCase):
+ """HealthCheckResult unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test HealthCheckResult
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.health_check_result.HealthCheckResult() # noqa: E501
+ if include_optional :
+ return HealthCheckResult(
+ nullable_message = ''
+ )
+ else :
+ return HealthCheckResult(
+ )
+
+ def testHealthCheckResult(self):
+ """Test HealthCheckResult"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_list.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_list.py
new file mode 100644
index 00000000000..7b001d818e8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_list.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.list import List # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestList(unittest.TestCase):
+ """List unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test List
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.list.List() # noqa: E501
+ if include_optional :
+ return List(
+ _123_list = ''
+ )
+ else :
+ return List(
+ )
+
+ def testList(self):
+ """Test List"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_map_test.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_map_test.py
new file mode 100644
index 00000000000..2618f59446f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_map_test.py
@@ -0,0 +1,64 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.map_test import MapTest # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestMapTest(unittest.TestCase):
+ """MapTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MapTest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.map_test.MapTest() # noqa: E501
+ if include_optional :
+ return MapTest(
+ map_map_of_string = {
+ 'key' : {
+ 'key' : ''
+ }
+ },
+ map_of_enum_string = {
+ 'UPPER' : 'UPPER'
+ },
+ direct_map = {
+ 'key' : True
+ },
+ indirect_map = {
+ 'key' : True
+ }
+ )
+ else :
+ return MapTest(
+ )
+
+ def testMapTest(self):
+ """Test MapTest"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_mixed_properties_and_additional_properties_class.py
new file mode 100644
index 00000000000..ec7666d4b0c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_mixed_properties_and_additional_properties_class.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
+ """MixedPropertiesAndAdditionalPropertiesClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MixedPropertiesAndAdditionalPropertiesClass
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
+ if include_optional :
+ return MixedPropertiesAndAdditionalPropertiesClass(
+ uuid = '',
+ date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ map = {
+ 'key' : petstore_api.models.animal.Animal(
+ class_name = '',
+ color = 'red', )
+ }
+ )
+ else :
+ return MixedPropertiesAndAdditionalPropertiesClass(
+ )
+
+ def testMixedPropertiesAndAdditionalPropertiesClass(self):
+ """Test MixedPropertiesAndAdditionalPropertiesClass"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_model200_response.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_model200_response.py
new file mode 100644
index 00000000000..343e3109ae0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_model200_response.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.model200_response import Model200Response # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestModel200Response(unittest.TestCase):
+ """Model200Response unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Model200Response
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.model200_response.Model200Response() # noqa: E501
+ if include_optional :
+ return Model200Response(
+ name = 56,
+ _class = ''
+ )
+ else :
+ return Model200Response(
+ )
+
+ def testModel200Response(self):
+ """Test Model200Response"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_model_return.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_model_return.py
new file mode 100644
index 00000000000..cd4afbbf973
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_model_return.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.model_return import ModelReturn # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestModelReturn(unittest.TestCase):
+ """ModelReturn unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ModelReturn
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.model_return.ModelReturn() # noqa: E501
+ if include_optional :
+ return ModelReturn(
+ _return = 56
+ )
+ else :
+ return ModelReturn(
+ )
+
+ def testModelReturn(self):
+ """Test ModelReturn"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_name.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_name.py
new file mode 100644
index 00000000000..a5114ce3a37
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_name.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.name import Name # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestName(unittest.TestCase):
+ """Name unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Name
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.name.Name() # noqa: E501
+ if include_optional :
+ return Name(
+ name = 56,
+ snake_case = 56,
+ _property = '',
+ _123_number = 56
+ )
+ else :
+ return Name(
+ name = 56,
+ )
+
+ def testName(self):
+ """Test Name"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_nullable_class.py
new file mode 100644
index 00000000000..a1ccadef241
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_nullable_class.py
@@ -0,0 +1,76 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.nullable_class import NullableClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestNullableClass(unittest.TestCase):
+ """NullableClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test NullableClass
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.nullable_class.NullableClass() # noqa: E501
+ if include_optional :
+ return NullableClass(
+ required_integer_prop = 56,
+ integer_prop = 56,
+ number_prop = 1.337,
+ boolean_prop = True,
+ string_prop = '',
+ date_prop = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
+ datetime_prop = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ array_nullable_prop = [
+ None
+ ],
+ array_and_items_nullable_prop = [
+ None
+ ],
+ array_items_nullable = [
+ None
+ ],
+ object_nullable_prop = {
+ 'key' : None
+ },
+ object_and_items_nullable_prop = {
+ 'key' : None
+ },
+ object_items_nullable = {
+ 'key' : None
+ }
+ )
+ else :
+ return NullableClass(
+ required_integer_prop = 56,
+ )
+
+ def testNullableClass(self):
+ """Test NullableClass"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_number_only.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_number_only.py
new file mode 100644
index 00000000000..0d3a7bfcc63
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_number_only.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.number_only import NumberOnly # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestNumberOnly(unittest.TestCase):
+ """NumberOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test NumberOnly
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.number_only.NumberOnly() # noqa: E501
+ if include_optional :
+ return NumberOnly(
+ just_number = 1.337
+ )
+ else :
+ return NumberOnly(
+ )
+
+ def testNumberOnly(self):
+ """Test NumberOnly"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_object_with_deprecated_fields.py
new file mode 100644
index 00000000000..f51638ec7b6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_object_with_deprecated_fields.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestObjectWithDeprecatedFields(unittest.TestCase):
+ """ObjectWithDeprecatedFields unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ObjectWithDeprecatedFields
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.object_with_deprecated_fields.ObjectWithDeprecatedFields() # noqa: E501
+ if include_optional :
+ return ObjectWithDeprecatedFields(
+ uuid = '',
+ id = 1.337,
+ deprecated_ref = petstore_api.models.deprecated_object.DeprecatedObject(
+ name = '', ),
+ bars = [
+ 'bar'
+ ]
+ )
+ else :
+ return ObjectWithDeprecatedFields(
+ )
+
+ def testObjectWithDeprecatedFields(self):
+ """Test ObjectWithDeprecatedFields"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_order.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_order.py
new file mode 100644
index 00000000000..feea3c6f564
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_order.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.order import Order # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOrder(unittest.TestCase):
+ """Order unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Order
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.order.Order() # noqa: E501
+ if include_optional :
+ return Order(
+ id = 56,
+ pet_id = 56,
+ quantity = 56,
+ ship_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ status = 'placed',
+ complete = True
+ )
+ else :
+ return Order(
+ )
+
+ def testOrder(self):
+ """Test Order"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_composite.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_composite.py
new file mode 100644
index 00000000000..9fb62a1397d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_composite.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.outer_composite import OuterComposite # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOuterComposite(unittest.TestCase):
+ """OuterComposite unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test OuterComposite
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501
+ if include_optional :
+ return OuterComposite(
+ my_number = 1.337,
+ my_string = '',
+ my_boolean = True
+ )
+ else :
+ return OuterComposite(
+ )
+
+ def testOuterComposite(self):
+ """Test OuterComposite"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_enum.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_enum.py
new file mode 100644
index 00000000000..a925744023d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_enum.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.outer_enum import OuterEnum # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOuterEnum(unittest.TestCase):
+ """OuterEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testOuterEnum(self):
+ """Test OuterEnum"""
+ # inst = OuterEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_enum_default_value.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_enum_default_value.py
new file mode 100644
index 00000000000..f8fba3bd79a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_enum_default_value.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOuterEnumDefaultValue(unittest.TestCase):
+ """OuterEnumDefaultValue unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testOuterEnumDefaultValue(self):
+ """Test OuterEnumDefaultValue"""
+ # inst = OuterEnumDefaultValue()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_enum_integer.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_enum_integer.py
new file mode 100644
index 00000000000..ce1e47c61b1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_enum_integer.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.outer_enum_integer import OuterEnumInteger # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOuterEnumInteger(unittest.TestCase):
+ """OuterEnumInteger unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testOuterEnumInteger(self):
+ """Test OuterEnumInteger"""
+ # inst = OuterEnumInteger()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_enum_integer_default_value.py
new file mode 100644
index 00000000000..3fed147cc50
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_enum_integer_default_value.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOuterEnumIntegerDefaultValue(unittest.TestCase):
+ """OuterEnumIntegerDefaultValue unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testOuterEnumIntegerDefaultValue(self):
+ """Test OuterEnumIntegerDefaultValue"""
+ # inst = OuterEnumIntegerDefaultValue()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_object_with_enum_property.py
new file mode 100644
index 00000000000..35258d5d74a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_outer_object_with_enum_property.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOuterObjectWithEnumProperty(unittest.TestCase):
+ """OuterObjectWithEnumProperty unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test OuterObjectWithEnumProperty
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.outer_object_with_enum_property.OuterObjectWithEnumProperty() # noqa: E501
+ if include_optional :
+ return OuterObjectWithEnumProperty(
+ value = 2
+ )
+ else :
+ return OuterObjectWithEnumProperty(
+ value = 2,
+ )
+
+ def testOuterObjectWithEnumProperty(self):
+ """Test OuterObjectWithEnumProperty"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_pet.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_pet.py
new file mode 100644
index 00000000000..1b98295f4d1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_pet.py
@@ -0,0 +1,68 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.pet import Pet # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestPet(unittest.TestCase):
+ """Pet unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Pet
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.pet.Pet() # noqa: E501
+ if include_optional :
+ return Pet(
+ id = 56,
+ category = petstore_api.models.category.Category(
+ id = 56,
+ name = 'default-name', ),
+ name = 'doggie',
+ photo_urls = [
+ ''
+ ],
+ tags = [
+ petstore_api.models.tag.Tag(
+ id = 56,
+ name = '', )
+ ],
+ status = 'available'
+ )
+ else :
+ return Pet(
+ name = 'doggie',
+ photo_urls = [
+ ''
+ ],
+ )
+
+ def testPet(self):
+ """Test Pet"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_pet_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_pet_api.py
new file mode 100644
index 00000000000..77665df879f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_pet_api.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.api.pet_api import PetApi # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestPetApi(unittest.TestCase):
+ """PetApi unit test stubs"""
+
+ def setUp(self):
+ self.api = petstore_api.api.pet_api.PetApi() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_add_pet(self):
+ """Test case for add_pet
+
+ Add a new pet to the store # noqa: E501
+ """
+ pass
+
+ def test_delete_pet(self):
+ """Test case for delete_pet
+
+ Deletes a pet # noqa: E501
+ """
+ pass
+
+ def test_find_pets_by_status(self):
+ """Test case for find_pets_by_status
+
+ Finds Pets by status # noqa: E501
+ """
+ pass
+
+ def test_find_pets_by_tags(self):
+ """Test case for find_pets_by_tags
+
+ Finds Pets by tags # noqa: E501
+ """
+ pass
+
+ def test_get_pet_by_id(self):
+ """Test case for get_pet_by_id
+
+ Find pet by ID # noqa: E501
+ """
+ pass
+
+ def test_update_pet(self):
+ """Test case for update_pet
+
+ Update an existing pet # noqa: E501
+ """
+ pass
+
+ def test_update_pet_with_form(self):
+ """Test case for update_pet_with_form
+
+ Updates a pet in the store with form data # noqa: E501
+ """
+ pass
+
+ def test_upload_file(self):
+ """Test case for upload_file
+
+ uploads an image # noqa: E501
+ """
+ pass
+
+ def test_upload_file_with_required_file(self):
+ """Test case for upload_file_with_required_file
+
+ uploads an image (required) # noqa: E501
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_pig.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_pig.py
new file mode 100644
index 00000000000..38389bae3ce
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_pig.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.pig import Pig # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestPig(unittest.TestCase):
+ """Pig unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Pig
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.pig.Pig() # noqa: E501
+ if include_optional :
+ return Pig(
+ class_name = '',
+ color = '',
+ size = 56
+ )
+ else :
+ return Pig(
+ class_name = '',
+ color = '',
+ size = 56,
+ )
+
+ def testPig(self):
+ """Test Pig"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_read_only_first.py
new file mode 100644
index 00000000000..a8b070b3631
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_read_only_first.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestReadOnlyFirst(unittest.TestCase):
+ """ReadOnlyFirst unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ReadOnlyFirst
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501
+ if include_optional :
+ return ReadOnlyFirst(
+ bar = '',
+ baz = ''
+ )
+ else :
+ return ReadOnlyFirst(
+ )
+
+ def testReadOnlyFirst(self):
+ """Test ReadOnlyFirst"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_self_reference_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_self_reference_model.py
new file mode 100644
index 00000000000..b3dd7ada2b2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_self_reference_model.py
@@ -0,0 +1,60 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.self_reference_model import SelfReferenceModel # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestSelfReferenceModel(unittest.TestCase):
+ """SelfReferenceModel unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test SelfReferenceModel
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `SelfReferenceModel`
+ """
+ model = petstore_api.models.self_reference_model.SelfReferenceModel() # noqa: E501
+ if include_optional :
+ return SelfReferenceModel(
+ size = 56,
+ nested = petstore_api.models.dummy_model.Dummy-Model(
+ category = '',
+ self_ref = petstore_api.models.self_reference_model.Self-Reference-Model(
+ size = 56,
+ nested = petstore_api.models.dummy_model.Dummy-Model(
+ category = '', ), ), )
+ )
+ else :
+ return SelfReferenceModel(
+ )
+ """
+
+ def testSelfReferenceModel(self):
+ """Test SelfReferenceModel"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_single_ref_type.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_single_ref_type.py
new file mode 100644
index 00000000000..31fbb0960ff
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_single_ref_type.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.single_ref_type import SingleRefType # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestSingleRefType(unittest.TestCase):
+ """SingleRefType unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testSingleRefType(self):
+ """Test SingleRefType"""
+ # inst = SingleRefType()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_special_model_name.py
new file mode 100644
index 00000000000..3553b6c41be
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_special_model_name.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.special_model_name import SpecialModelName # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestSpecialModelName(unittest.TestCase):
+ """SpecialModelName unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test SpecialModelName
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501
+ if include_optional :
+ return SpecialModelName(
+ special_property_name = 56
+ )
+ else :
+ return SpecialModelName(
+ )
+
+ def testSpecialModelName(self):
+ """Test SpecialModelName"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_special_name.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_special_name.py
new file mode 100644
index 00000000000..37a7235a8c3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_special_name.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.special_name import SpecialName # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestSpecialName(unittest.TestCase):
+ """SpecialName unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test SpecialName
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `SpecialName`
+ """
+ model = petstore_api.models.special_name.SpecialName() # noqa: E501
+ if include_optional :
+ return SpecialName(
+ var_property = 56,
+ var_async = petstore_api.models.category.Category(
+ id = 56,
+ name = 'default-name', ),
+ var_schema = 'available'
+ )
+ else :
+ return SpecialName(
+ )
+ """
+
+ def testSpecialName(self):
+ """Test SpecialName"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_store_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_store_api.py
new file mode 100644
index 00000000000..81848d24a67
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_store_api.py
@@ -0,0 +1,61 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.api.store_api import StoreApi # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestStoreApi(unittest.TestCase):
+ """StoreApi unit test stubs"""
+
+ def setUp(self):
+ self.api = petstore_api.api.store_api.StoreApi() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_delete_order(self):
+ """Test case for delete_order
+
+ Delete purchase order by ID # noqa: E501
+ """
+ pass
+
+ def test_get_inventory(self):
+ """Test case for get_inventory
+
+ Returns pet inventories by status # noqa: E501
+ """
+ pass
+
+ def test_get_order_by_id(self):
+ """Test case for get_order_by_id
+
+ Find purchase order by ID # noqa: E501
+ """
+ pass
+
+ def test_place_order(self):
+ """Test case for place_order
+
+ Place an order for a pet # noqa: E501
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_tag.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_tag.py
new file mode 100644
index 00000000000..e75884bc136
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_tag.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.tag import Tag # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestTag(unittest.TestCase):
+ """Tag unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Tag
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.tag.Tag() # noqa: E501
+ if include_optional :
+ return Tag(
+ id = 56,
+ name = ''
+ )
+ else :
+ return Tag(
+ )
+
+ def testTag(self):
+ """Test Tag"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_user.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_user.py
new file mode 100644
index 00000000000..b19c3a7443f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_user.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.user import User # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestUser(unittest.TestCase):
+ """User unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test User
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.user.User() # noqa: E501
+ if include_optional :
+ return User(
+ id = 56,
+ username = '',
+ first_name = '',
+ last_name = '',
+ email = '',
+ password = '',
+ phone = '',
+ user_status = 56
+ )
+ else :
+ return User(
+ )
+
+ def testUser(self):
+ """Test User"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_user_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_user_api.py
new file mode 100644
index 00000000000..6df730fba2b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_user_api.py
@@ -0,0 +1,89 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.api.user_api import UserApi # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestUserApi(unittest.TestCase):
+ """UserApi unit test stubs"""
+
+ def setUp(self):
+ self.api = petstore_api.api.user_api.UserApi() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_create_user(self):
+ """Test case for create_user
+
+ Create user # noqa: E501
+ """
+ pass
+
+ def test_create_users_with_array_input(self):
+ """Test case for create_users_with_array_input
+
+ Creates list of users with given input array # noqa: E501
+ """
+ pass
+
+ def test_create_users_with_list_input(self):
+ """Test case for create_users_with_list_input
+
+ Creates list of users with given input array # noqa: E501
+ """
+ pass
+
+ def test_delete_user(self):
+ """Test case for delete_user
+
+ Delete user # noqa: E501
+ """
+ pass
+
+ def test_get_user_by_name(self):
+ """Test case for get_user_by_name
+
+ Get user by user name # noqa: E501
+ """
+ pass
+
+ def test_login_user(self):
+ """Test case for login_user
+
+ Logs user into the system # noqa: E501
+ """
+ pass
+
+ def test_logout_user(self):
+ """Test case for logout_user
+
+ Logs out current logged in user session # noqa: E501
+ """
+ pass
+
+ def test_update_user(self):
+ """Test case for update_user
+
+ Updated user # noqa: E501
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_with_nested_one_of.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_with_nested_one_of.py
new file mode 100644
index 00000000000..a0123fd14c4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_with_nested_one_of.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.with_nested_one_of import WithNestedOneOf # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestWithNestedOneOf(unittest.TestCase):
+ """WithNestedOneOf unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test WithNestedOneOf
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.with_nested_one_of.WithNestedOneOf() # noqa: E501
+ if include_optional :
+ return WithNestedOneOf(
+ size = 56,
+ nested_pig = None
+ )
+ else :
+ return WithNestedOneOf(
+ )
+
+ def testWithNestedOneOf(self):
+ """Test WithNestedOneOf"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test_python3.sh b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test_python3.sh
new file mode 100755
index 00000000000..ef758bd4450
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test_python3.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+REQUIREMENTS_FILE=dev-requirements.txt
+REQUIREMENTS_OUT=dev-requirements.txt.log
+SETUP_OUT=*.egg-info
+VENV=.venv
+DEACTIVE=false
+
+export LC_ALL=en_US.UTF-8
+export LANG=en_US.UTF-8
+
+### set virtualenv
+if [ -z "$VIRTUAL_ENV" ]; then
+ virtualenv $VENV --always-copy
+ source $VENV/bin/activate
+ DEACTIVE=true
+fi
+
+### install dependencies
+pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
+
+### run tests
+tox || exit 1
+
+### static analysis of code
+#flake8 --show-source petstore_api/
+
+### deactivate virtualenv
+#if [ $DEACTIVE == true ]; then
+# deactivate
+#fi
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/testfiles/foo.png b/samples/openapi3/client/petstore/python-nextgen-aiohttp/testfiles/foo.png
new file mode 100644
index 00000000000..a9b12cf5927
Binary files /dev/null and b/samples/openapi3/client/petstore/python-nextgen-aiohttp/testfiles/foo.png differ
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/__init__.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/test_api_client.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/test_api_client.py
new file mode 100644
index 00000000000..bf4ab329f29
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/test_api_client.py
@@ -0,0 +1,27 @@
+# coding: utf-8
+
+# flake8: noqa
+
+import unittest
+import weakref
+
+from tests.util import async_test
+import petstore_api
+
+
+class TestApiClient(unittest.TestCase):
+
+ @async_test
+ async def test_context_manager_closes_client(self):
+
+ async with petstore_api.ApiClient() as client:
+ # thread pool
+ self.assertIsNotNone(client.pool)
+ pool_ref = weakref.ref(client._pool)
+ self.assertIsNotNone(pool_ref())
+ # pool_manager
+ self.assertFalse(client.rest_client.pool_manager.closed)
+ rest_pool_ref = client.rest_client.pool_manager
+
+ self.assertIsNone(pool_ref())
+ self.assertTrue(rest_pool_ref.closed)
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/test_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/test_model.py
new file mode 100644
index 00000000000..5abbb35ca0c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/test_model.py
@@ -0,0 +1,228 @@
+# coding: utf-8
+
+# flake8: noqa
+
+
+import os
+import time
+import unittest
+
+import petstore_api
+
+
+class ModelTests(unittest.TestCase):
+
+ def setUp(self):
+ self.pet = petstore_api.Pet(name="test name", photo_urls=["string"])
+ self.pet.id = 1
+ self.pet.status = "available"
+ cate = petstore_api.Category(name="dog")
+ cate.id = 1
+ cate.name = "dog"
+ self.pet.category = cate
+ tag = petstore_api.Tag()
+ tag.id = 1
+ self.pet.tags = [tag]
+
+ def test_cat(self):
+ self.cat = petstore_api.Cat(class_name="cat")
+ self.assertEqual("cat", self.cat.class_name)
+ self.assertEqual("red", self.cat.color)
+ cat_str = "{'className': 'cat', 'color': 'red', 'declawed': None}"
+ self.assertEqual(cat_str, self.cat.to_str())
+
+ def test_to_str(self):
+ data = ("{'category': {'id': 1, 'name': 'dog'},\n"
+ " 'id': 1,\n"
+ " 'name': 'test name',\n"
+ " 'photoUrls': ['string'],\n"
+ " 'status': 'available',\n"
+ " 'tags': [{'id': 1, 'name': None}]}")
+ self.assertEqual(data, self.pet.to_str())
+
+ def test_equal(self):
+ self.pet1 = petstore_api.Pet(name="test name", photo_urls=["string"])
+ self.pet1.id = 1
+ self.pet1.status = "available"
+ cate1 = petstore_api.Category(name="dog")
+ cate1.id = 1
+ # cate1.name = "dog"
+ self.pet.category = cate1
+ tag1 = petstore_api.Tag()
+ tag1.id = 1
+ self.pet1.tags = [tag1]
+
+ self.pet2 = petstore_api.Pet(name="test name", photo_urls=["string"])
+ self.pet2.id = 1
+ self.pet2.status = "available"
+ cate2 = petstore_api.Category(name="dog")
+ cate2.id = 1
+ cate2.name = "dog"
+ self.pet.category = cate2
+ tag2 = petstore_api.Tag()
+ tag2.id = 1
+ self.pet2.tags = [tag2]
+
+ self.assertTrue(self.pet1 == self.pet2)
+
+ # reset pet1 tags to empty array so that object comparison returns false
+ self.pet1.tags = []
+ self.assertFalse(self.pet1 == self.pet2)
+
+ def test_oneOf(self):
+ # test new Pig
+ new_pig = petstore_api.Pig()
+ self.assertEqual("null", new_pig.to_json())
+ self.assertEqual(None, new_pig.actual_instance)
+
+ # test from_json
+ json_str = '{"className": "BasquePig", "color": "red"}'
+ p = petstore_api.Pig.from_json(json_str)
+ self.assertIsInstance(p.actual_instance, petstore_api.BasquePig)
+
+ # test init
+ basque_pig = p.actual_instance
+ pig2 = petstore_api.Pig(actual_instance=basque_pig)
+ self.assertIsInstance(pig2.actual_instance, petstore_api.BasquePig)
+
+ # test failed init
+ try:
+ pig3 = petstore_api.Pig(actual_instance="123")
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ self.assertTrue(
+ "No match found when deserializing the JSON string into Pig with oneOf schemas: "
+ "BasquePig, DanishPig" in str(e))
+
+ # failure
+ try:
+ p2 = petstore_api.Pig.from_json("1")
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ error_message = (
+ "No match found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. "
+ "Details: 1 validation error for BasquePig\n"
+ "__root__\n"
+ " BasquePig expected dict not int (type=type_error), 1 validation error for DanishPig\n"
+ "__root__\n"
+ " DanishPig expected dict not int (type=type_error)")
+ self.assertEqual(str(e), error_message)
+
+ # test to_json
+ self.assertEqual(p.to_json(), '{"className": "BasquePig", "color": "red"}')
+
+ # test nested property
+ nested = petstore_api.WithNestedOneOf(size = 1, nested_pig = p)
+ self.assertEqual(nested.to_json(), '{"size": 1, "nested_pig": {"className": "BasquePig", "color": "red"}}')
+
+ nested_json = nested.to_json()
+ nested2 = petstore_api.WithNestedOneOf.from_json(nested_json)
+ self.assertEqual(nested2.to_json(), nested_json)
+
+ def test_anyOf(self):
+ # test new AnyOfPig
+ new_anypig = petstore_api.AnyOfPig()
+ self.assertEqual("null", new_anypig.to_json())
+ self.assertEqual(None, new_anypig.actual_instance)
+
+ # test from_json
+ json_str = '{"className": "BasquePig", "color": "red"}'
+ p = petstore_api.AnyOfPig.from_json(json_str)
+ self.assertIsInstance(p.actual_instance, petstore_api.BasquePig)
+
+ # test init
+ basque_pig = p.actual_instance
+ pig2 = petstore_api.Pig(actual_instance=basque_pig)
+ self.assertIsInstance(pig2.actual_instance, petstore_api.BasquePig)
+
+ # test failed init
+ try:
+ pig3 = petstore_api.AnyOfPig(actual_instance="123")
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ self.assertTrue(
+ "No match found when deserializing the JSON string into AnyOfPig with anyOf schemas: BasquePig, "
+ "DanishPig" in str(e))
+
+ # failure
+ try:
+ p2 = petstore_api.AnyOfPig.from_json("1")
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ error_message = (
+ "No match found when deserializing the JSON string into AnyOfPig with anyOf schemas: BasquePig, "
+ "DanishPig. Details: 1 validation error for BasquePig\n"
+ "__root__\n"
+ " BasquePig expected dict not int (type=type_error), 1 validation error for DanishPig\n"
+ "__root__\n"
+ " DanishPig expected dict not int (type=type_error)")
+ self.assertEqual(str(e), error_message)
+
+ # test to_json
+ self.assertEqual(p.to_json(), '{"className": "BasquePig", "color": "red"}')
+
+ def test_inheritance(self):
+ dog = petstore_api.Dog(breed="bulldog", className="dog", color="white")
+ self.assertEqual(dog.to_json(), '{"className": "dog", "color": "white", "breed": "bulldog"}')
+ self.assertEqual(dog.to_dict(), {'breed': 'bulldog', 'className':
+ 'dog', 'color': 'white'})
+ dog2 = petstore_api.Dog.from_json(dog.to_json())
+ self.assertEqual(dog2.breed, 'bulldog')
+ self.assertEqual(dog2.class_name, "dog")
+ self.assertEqual(dog2.color, 'white')
+
+ def test_list(self):
+ # should throw exception as var_123_list should be string
+ try:
+ l3 = petstore_api.List(var_123_list=123)
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ #error_message = (
+ # "1 validation error for List\n"
+ # "123-list\n"
+ # " str type expected (type=type_error.str)\n")
+ self.assertTrue("str type expected" in str(e))
+
+ l = petstore_api.List(var_123_list="bulldog")
+ self.assertEqual(l.to_json(), '{"123-list": "bulldog"}')
+ self.assertEqual(l.to_dict(), {'123-list': 'bulldog'})
+ l2 = petstore_api.List.from_json(l.to_json())
+ self.assertEqual(l2.var_123_list, 'bulldog')
+
+ self.assertTrue(isinstance(l2, petstore_api.List))
+
+ def test_enum_ref_property(self):
+ # test enum ref property
+ # test to_json
+ d = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1)
+ self.assertEqual(d.to_json(), '{"value": 1, "str_value": null}')
+ d2 = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1, str_value=petstore_api.OuterEnum.DELIVERED)
+ self.assertEqual(d2.to_json(), '{"str_value": "delivered", "value": 1}')
+ # test from_json (round trip)
+ d3 = petstore_api.OuterObjectWithEnumProperty.from_json(d2.to_json())
+ self.assertEqual(d3.str_value, petstore_api.OuterEnum.DELIVERED)
+ self.assertEqual(d3.value, petstore_api.OuterEnumInteger.NUMBER_1)
+ self.assertEqual(d3.to_json(), '{"str_value": "delivered", "value": 1}')
+
+ def test_valdiator(self):
+ # test regular expression
+ a = petstore_api.FormatTest(number=123.45, byte=bytes("string", 'utf-8'), date="2013-09-17", password="testing09876")
+ try:
+ a.pattern_with_digits_and_delimiter = "123"
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ self.assertTrue("must validate the regular expression /^image_\d{1,3}$/i" in str(e))
+
+ a.pattern_with_digits_and_delimiter = "IMAGE_123"
+ self.assertEqual(a.pattern_with_digits_and_delimiter, "IMAGE_123")
+ a.pattern_with_digits_and_delimiter = "image_123"
+ self.assertEqual(a.pattern_with_digits_and_delimiter, "image_123")
+
+ def test_inline_enum_validator(self):
+ self.pet = petstore_api.Pet(name="test name", photo_urls=["string"])
+ self.pet.id = 1
+ try:
+ self.pet.status = "error"
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ self.assertTrue("must validate the enum values ('available', 'pending', 'sold')" in str(e))
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/test_pet_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/test_pet_api.py
new file mode 100644
index 00000000000..33b3a84bc0e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/test_pet_api.py
@@ -0,0 +1,203 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ docker pull swaggerapi/petstore
+$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
+$ pytest -vv
+"""
+
+import os
+import unittest
+import asyncio
+import pytest
+
+import petstore_api
+from petstore_api import Configuration
+from petstore_api.rest import ApiException
+
+from .util import id_gen, async_test
+
+import json
+
+import urllib3
+
+HOST = 'http://localhost:80/v2'
+
+
+class TestPetApiTests(unittest.TestCase):
+
+ def setUp(self):
+ config = Configuration()
+ config.host = HOST
+
+ self.api_client = petstore_api.ApiClient(config)
+ self.pet_api = petstore_api.PetApi(self.api_client)
+ self.setUpModels()
+ self.setUpFiles()
+
+ def setUpModels(self):
+ self.category = petstore_api.Category(id=id_gen(), name="dog")
+ #self.category.id = id_gen()
+ #self.category.name = "dog"
+ self.tag = petstore_api.Tag()
+ self.tag.id = id_gen()
+ self.tag.name = "openapi-generator-python-pet-tag"
+ self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
+ self.pet.id = id_gen()
+ self.pet.status = "sold"
+ self.pet.category = self.category
+ self.pet.tags = [self.tag]
+
+ def setUpFiles(self):
+ self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles")
+ self.test_file_dir = os.path.realpath(self.test_file_dir)
+ self.foo = os.path.join(self.test_file_dir, "foo.png")
+
+ def test_separate_default_client_instances(self):
+ pet_api = petstore_api.PetApi()
+ pet_api2 = petstore_api.PetApi()
+ self.assertEqual(id(pet_api.api_client), id(pet_api2.api_client))
+
+ def test_separate_default_config_instances(self):
+ pet_api = petstore_api.PetApi()
+ pet_api2 = petstore_api.PetApi()
+ self.assertEqual(id(pet_api.api_client.configuration), id(pet_api2.api_client.configuration))
+
+ @async_test
+ async def test_async_with_result(self):
+ await self.pet_api.add_pet(self.pet)
+
+ calls = [self.pet_api.get_pet_by_id(self.pet.id),
+ self.pet_api.get_pet_by_id(self.pet.id)]
+
+ responses, _ = await asyncio.wait(calls)
+ for response in responses:
+ self.assertEqual(response.result().id, self.pet.id)
+ self.assertEqual(len(responses), 2)
+
+ @async_test
+ async def test_exception(self):
+ await self.pet_api.add_pet(self.pet)
+
+ try:
+ await self.pet_api.get_pet_by_id(9999999999999)
+ except ApiException as e:
+ exception = e
+
+ self.assertIsInstance(exception, ApiException)
+ self.assertEqual(exception.status, 404)
+
+ @async_test
+ async def test_add_pet_and_get_pet_by_id(self):
+ await self.pet_api.add_pet(self.pet)
+
+ fetched = await self.pet_api.get_pet_by_id(pet_id=self.pet.id)
+ self.assertIsNotNone(fetched)
+ self.assertEqual(self.pet.id, fetched.id)
+ self.assertIsNotNone(fetched.category)
+ self.assertEqual(self.pet.category.name, fetched.category.name)
+
+ @async_test
+ async def test_add_pet_and_get_pet_by_id_with_http_info(self):
+ await self.pet_api.add_pet(self.pet)
+
+ fetched = await self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id)
+ self.assertIsNotNone(fetched)
+ self.assertEqual(self.pet.id, fetched[0].id)
+ self.assertIsNotNone(fetched[0].category)
+ self.assertEqual(self.pet.category.name, fetched[0].category.name)
+
+ @async_test
+ async def test_update_pet(self):
+ self.pet.name = "hello kity with updated"
+ await self.pet_api.update_pet(self.pet)
+
+ fetched = await self.pet_api.get_pet_by_id(pet_id=self.pet.id)
+ self.assertIsNotNone(fetched)
+ self.assertEqual(self.pet.id, fetched.id)
+ self.assertEqual(self.pet.name, fetched.name)
+ self.assertIsNotNone(fetched.category)
+ self.assertEqual(fetched.category.name, self.pet.category.name)
+
+ @async_test
+ async def test_find_pets_by_status(self):
+ await self.pet_api.add_pet(self.pet)
+ pets = await self.pet_api.find_pets_by_status(status=[self.pet.status])
+ self.assertIn(
+ self.pet.id,
+ list(map(lambda x: getattr(x, 'id'), pets))
+ )
+
+ @async_test
+ async def test_find_pets_by_tags(self):
+ await self.pet_api.add_pet(self.pet)
+ pets = await self.pet_api.find_pets_by_tags(tags=[self.tag.name])
+ self.assertIn(
+ self.pet.id,
+ list(map(lambda x: getattr(x, 'id'), pets))
+ )
+
+ @async_test
+ async def test_update_pet_with_form(self):
+ await self.pet_api.add_pet(self.pet)
+
+ name = "hello kity with form updated"
+ status = "pending"
+ await self.pet_api.update_pet_with_form(pet_id=self.pet.id, name=name, status=status)
+
+ fetched = await self.pet_api.get_pet_by_id(pet_id=self.pet.id)
+ self.assertEqual(self.pet.id, fetched.id)
+ self.assertEqual(name, fetched.name)
+ self.assertEqual(status, fetched.status)
+
+ @async_test
+ async def test_upload_file(self):
+ # upload file with form parameter
+ try:
+ additional_metadata = "special"
+ await self.pet_api.upload_file(
+ pet_id=self.pet.id,
+ additional_metadata=additional_metadata,
+ file=self.foo
+ )
+ except ApiException as e:
+ self.fail("upload_file() raised {0} unexpectedly".format(type(e)))
+
+ # upload only file
+ try:
+ await self.pet_api.upload_file(pet_id=self.pet.id, file=self.foo)
+ except ApiException as e:
+ self.fail("upload_file() raised {0} unexpectedly".format(type(e)))
+
+ @async_test
+ async def test_delete_pet(self):
+ await self.pet_api.add_pet(self.pet)
+ await self.pet_api.delete_pet(pet_id=self.pet.id, api_key="special-key")
+
+ try:
+ await self.pet_api.get_pet_by_id(pet_id=self.pet.id)
+ raise Exception("expected an error")
+ except ApiException as e:
+ self.assertEqual(404, e.status)
+
+ @async_test
+ async def test_proxy(self):
+ config = Configuration()
+ # set not-existent proxy and catch an error to verify that
+ # the client library (aiohttp) tried to use it.
+ config.proxy = 'http://localhost:8080/proxy'
+ async with petstore_api.ApiClient(config) as client:
+ pet_api = petstore_api.PetApi(client)
+
+ with self.assertRaisesRegex(petstore_api.rest.aiohttp.client_exceptions.ClientProxyConnectionError,
+ 'Cannot connect to host localhost:8080'):
+ await pet_api.get_pet_by_id(self.pet.id)
+
+
+if __name__ == '__main__':
+ import logging
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/test_pet_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/test_pet_model.py
new file mode 100644
index 00000000000..078011e24a3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/test_pet_model.py
@@ -0,0 +1,114 @@
+# coding: utf-8
+
+# flake8: noqa
+
+import os
+import time
+import unittest
+
+import petstore_api
+import json
+from pydantic import ValidationError
+
+
+class PetModelTests(unittest.TestCase):
+
+ def setUp(self):
+ self.pet = petstore_api.Pet(name="test name", photo_urls=["string"])
+ self.pet.id = 1
+ self.pet.status = "available"
+ cate = petstore_api.Category(name="dog")
+ cate.id = 1
+ # cate.name = "dog"
+ self.pet.category = cate
+ tag = petstore_api.Tag()
+ tag.id = 1
+ self.pet.tags = [tag]
+
+ def test_to_str(self):
+ data = ("{'category': {'id': 1, 'name': 'dog'},\n"
+ " 'id': 1,\n"
+ " 'name': 'test name',\n"
+ " 'photoUrls': ['string'],\n"
+ " 'status': 'available',\n"
+ " 'tags': [{'id': 1, 'name': None}]}")
+ self.assertEqual(data, self.pet.to_str())
+
+ def test_equal(self):
+ self.pet1 = petstore_api.Pet(name="test name", photo_urls=["string"])
+ self.pet1.id = 1
+ self.pet1.status = "available"
+ cate1 = petstore_api.Category(name="dog")
+ cate1.id = 1
+ # cate1.name = "dog"
+ self.pet.category = cate1
+ tag1 = petstore_api.Tag()
+ tag1.id = 1
+ self.pet1.tags = [tag1]
+
+ self.pet2 = petstore_api.Pet(name="test name", photo_urls=["string"])
+ self.pet2.id = 1
+ self.pet2.status = "available"
+ cate2 = petstore_api.Category(name="dog")
+ cate2.id = 1
+ # cate2.name = "dog"
+ self.pet.category = cate2
+ tag2 = petstore_api.Tag()
+ tag2.id = 1
+ self.pet2.tags = [tag2]
+
+ self.assertTrue(self.pet1 == self.pet2)
+
+ # reset pet1 tags to empty array so that object comparison returns false
+ self.pet1.tags = []
+ self.assertFalse(self.pet1 == self.pet2)
+
+ # test from_json, to_json, to_dict, from_dict
+ def test_from_to_methods(self):
+ json_str = ("{\"category\": {\"id\": 1, \"name\": \"dog\"},\n"
+ " \"id\": 1,\n"
+ " \"name\": \"test name\",\n"
+ " \"photoUrls\": [\"string\"],\n"
+ " \"status\": \"available\",\n"
+ " \"tags\": [{\"id\": 1, \"name\": \"None\"}]}")
+ pet = petstore_api.Pet.from_json(json_str)
+ self.assertEqual(pet.id, 1)
+ self.assertEqual(pet.status, "available")
+ self.assertEqual(pet.photo_urls, ["string"])
+ self.assertEqual(pet.tags[0].id, 1)
+ self.assertEqual(pet.tags[0].name, "None")
+ self.assertEqual(pet.category.id, 1)
+ # test to_json
+ self.assertEqual(pet.to_json(),
+ '{"id": 1, "category": {"id": 1, "name": "dog"}, "name": "test name", "photoUrls": ['
+ '"string"], "tags": [{"id": 1, "name": "None"}], "status": "available"}')
+
+ # test to_dict
+ self.assertEqual(pet.to_dict(),
+ {"id": 1, "category": {"id": 1, "name": "dog"}, "name": "test name", "photoUrls": ["string"],
+ "tags": [{"id": 1, "name": "None"}], "status": "available"})
+
+ # test from_dict
+ pet2 = petstore_api.Pet.from_dict(pet.to_dict())
+ self.assertEqual(pet2.id, 1)
+ self.assertEqual(pet2.status, "available")
+ self.assertEqual(pet2.photo_urls, ["string"])
+ self.assertEqual(pet2.tags[0].id, 1)
+ self.assertEqual(pet2.tags[0].name, "None")
+ self.assertEqual(pet2.category.id, 1)
+
+ def test_unpack_operator(self):
+ d = {"name": "required name", "id": 123, "photoUrls": ["https://a.com", "https://b.com"]}
+ pet = petstore_api.Pet(**d)
+ self.assertEqual(pet.to_json(), '{"id": 123, "name": "required name", "photoUrls": ["https://a.com", "https://b.com"]}')
+ self.assertEqual(pet.to_dict(), {"id": 123, "name": "required name", "photoUrls": ["https://a.com", "https://b.com"]})
+
+ def test_optional_fields(self):
+ pet = petstore_api.Pet(name="required name",
+ photoUrls=["https://a.com",
+ "https://b.com"])
+ self.assertEqual(pet.to_json(), '{"name": "required name", "photoUrls": ["https://a.com", "https://b.com"]}')
+ self.assertEqual(pet.to_dict(), {"name": "required name", "photoUrls": ["https://a.com", "https://b.com"]})
+
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/util.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/util.py
new file mode 100644
index 00000000000..8edec757009
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/util.py
@@ -0,0 +1,18 @@
+# flake8: noqa
+
+import asyncio
+import random
+
+
+def id_gen(bits=32):
+ """ Returns a n-bit randomly generated int """
+ return int(random.getrandbits(bits))
+
+
+def async_test(f):
+ def wrapper(*args, **kwargs):
+ coro = asyncio.coroutine(f)
+ future = coro(*args, **kwargs)
+ loop = asyncio.get_event_loop()
+ loop.run_until_complete(future)
+ return wrapper
diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/tox.ini b/samples/openapi3/client/petstore/python-nextgen-aiohttp/tox.ini
new file mode 100644
index 00000000000..8989fc3c4d9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/tox.ini
@@ -0,0 +1,9 @@
+[tox]
+envlist = py3
+
+[testenv]
+deps=-r{toxinidir}/requirements.txt
+ -r{toxinidir}/test-requirements.txt
+
+commands=
+ pytest --cov=petstore_api
diff --git a/samples/openapi3/client/petstore/python-nextgen/.github/workflows/python.yml b/samples/openapi3/client/petstore/python-nextgen/.github/workflows/python.yml
new file mode 100644
index 00000000000..28a13b8f38e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/.github/workflows/python.yml
@@ -0,0 +1,37 @@
+# NOTE: This file is auto generated by OpenAPI Generator.
+# URL: https://openapi-generator.tech
+#
+# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
+
+name: petstore_api Python package
+
+on: [push, pull_request]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: ["3.7", "3.8", "3.9", "3.10"]
+
+ steps:s
+ - uses: actions/checkout@v3
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}s
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install flake8 pytest
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+ - name: Lint with flake8
+ run: |
+ # stop the build if there are Python syntax errors or undefined names
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
+ - name: Test with pytest
+ run: |
+ pytest
\ No newline at end of file
diff --git a/samples/openapi3/client/petstore/python-nextgen/.gitignore b/samples/openapi3/client/petstore/python-nextgen/.gitignore
new file mode 100755
index 00000000000..43995bd42fa
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/.gitignore
@@ -0,0 +1,66 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+.hypothesis/
+venv/
+.venv/
+.python-version
+.pytest_cache
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+#Ipython Notebook
+.ipynb_checkpoints
diff --git a/samples/openapi3/client/petstore/python-nextgen/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-nextgen/.gitlab-ci.yml
new file mode 100755
index 00000000000..1d94e384696
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/.gitlab-ci.yml
@@ -0,0 +1,25 @@
+# NOTE: This file is auto generated by OpenAPI Generator.
+# URL: https://openapi-generator.tech
+#
+# ref: https://docs.gitlab.com/ee/ci/README.html
+# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
+
+stages:
+ - test
+
+.pytest:
+ stage: test
+ script:
+ - pip install -r requirements.txt
+ - pip install -r test-requirements.txt
+ - pytest --cov=petstore_api
+
+pytest-3.7:
+ extends: .pytest
+ image: python:3.7-alpine
+pytest-3.8:
+ extends: .pytest
+ image: python:3.8-alpine
+pytest-3.9:
+ extends: .pytest
+ image: python:3.9-alpine
\ No newline at end of file
diff --git a/samples/openapi3/client/petstore/python-nextgen/.openapi-generator-ignore b/samples/openapi3/client/petstore/python-nextgen/.openapi-generator-ignore
new file mode 100755
index 00000000000..1e66827c8f8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/.openapi-generator-ignore
@@ -0,0 +1,24 @@
+# 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
+tox.ini
diff --git a/samples/openapi3/client/petstore/python-nextgen/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-nextgen/.openapi-generator/FILES
new file mode 100755
index 00000000000..6de662a87b4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/.openapi-generator/FILES
@@ -0,0 +1,145 @@
+.github/workflows/python.yml
+.gitignore
+.gitlab-ci.yml
+.travis.yml
+README.md
+docs/AdditionalPropertiesClass.md
+docs/AllOfWithSingleRef.md
+docs/Animal.md
+docs/AnotherFakeApi.md
+docs/AnyOfPig.md
+docs/ApiResponse.md
+docs/ArrayOfArrayOfNumberOnly.md
+docs/ArrayOfNumberOnly.md
+docs/ArrayTest.md
+docs/BasquePig.md
+docs/Capitalization.md
+docs/Cat.md
+docs/CatAllOf.md
+docs/Category.md
+docs/ClassModel.md
+docs/Client.md
+docs/DanishPig.md
+docs/DefaultApi.md
+docs/DeprecatedObject.md
+docs/Dog.md
+docs/DogAllOf.md
+docs/DummyModel.md
+docs/EnumArrays.md
+docs/EnumClass.md
+docs/EnumTest.md
+docs/FakeApi.md
+docs/FakeClassnameTags123Api.md
+docs/File.md
+docs/FileSchemaTestClass.md
+docs/Foo.md
+docs/FooGetDefaultResponse.md
+docs/FormatTest.md
+docs/HasOnlyReadOnly.md
+docs/HealthCheckResult.md
+docs/List.md
+docs/MapTest.md
+docs/MixedPropertiesAndAdditionalPropertiesClass.md
+docs/Model200Response.md
+docs/ModelReturn.md
+docs/Name.md
+docs/NullableClass.md
+docs/NumberOnly.md
+docs/ObjectWithDeprecatedFields.md
+docs/Order.md
+docs/OuterComposite.md
+docs/OuterEnum.md
+docs/OuterEnumDefaultValue.md
+docs/OuterEnumInteger.md
+docs/OuterEnumIntegerDefaultValue.md
+docs/OuterObjectWithEnumProperty.md
+docs/Pet.md
+docs/PetApi.md
+docs/Pig.md
+docs/ReadOnlyFirst.md
+docs/SelfReferenceModel.md
+docs/SingleRefType.md
+docs/SpecialModelName.md
+docs/SpecialName.md
+docs/StoreApi.md
+docs/Tag.md
+docs/User.md
+docs/UserApi.md
+docs/WithNestedOneOf.md
+git_push.sh
+petstore_api/__init__.py
+petstore_api/api/__init__.py
+petstore_api/api/another_fake_api.py
+petstore_api/api/default_api.py
+petstore_api/api/fake_api.py
+petstore_api/api/fake_classname_tags123_api.py
+petstore_api/api/pet_api.py
+petstore_api/api/store_api.py
+petstore_api/api/user_api.py
+petstore_api/api_client.py
+petstore_api/configuration.py
+petstore_api/exceptions.py
+petstore_api/models/__init__.py
+petstore_api/models/additional_properties_class.py
+petstore_api/models/all_of_with_single_ref.py
+petstore_api/models/animal.py
+petstore_api/models/any_of_pig.py
+petstore_api/models/api_response.py
+petstore_api/models/array_of_array_of_number_only.py
+petstore_api/models/array_of_number_only.py
+petstore_api/models/array_test.py
+petstore_api/models/basque_pig.py
+petstore_api/models/capitalization.py
+petstore_api/models/cat.py
+petstore_api/models/cat_all_of.py
+petstore_api/models/category.py
+petstore_api/models/class_model.py
+petstore_api/models/client.py
+petstore_api/models/danish_pig.py
+petstore_api/models/deprecated_object.py
+petstore_api/models/dog.py
+petstore_api/models/dog_all_of.py
+petstore_api/models/dummy_model.py
+petstore_api/models/enum_arrays.py
+petstore_api/models/enum_class.py
+petstore_api/models/enum_test.py
+petstore_api/models/file.py
+petstore_api/models/file_schema_test_class.py
+petstore_api/models/foo.py
+petstore_api/models/foo_get_default_response.py
+petstore_api/models/format_test.py
+petstore_api/models/has_only_read_only.py
+petstore_api/models/health_check_result.py
+petstore_api/models/list.py
+petstore_api/models/map_test.py
+petstore_api/models/mixed_properties_and_additional_properties_class.py
+petstore_api/models/model200_response.py
+petstore_api/models/model_return.py
+petstore_api/models/name.py
+petstore_api/models/nullable_class.py
+petstore_api/models/number_only.py
+petstore_api/models/object_with_deprecated_fields.py
+petstore_api/models/order.py
+petstore_api/models/outer_composite.py
+petstore_api/models/outer_enum.py
+petstore_api/models/outer_enum_default_value.py
+petstore_api/models/outer_enum_integer.py
+petstore_api/models/outer_enum_integer_default_value.py
+petstore_api/models/outer_object_with_enum_property.py
+petstore_api/models/pet.py
+petstore_api/models/pig.py
+petstore_api/models/read_only_first.py
+petstore_api/models/self_reference_model.py
+petstore_api/models/single_ref_type.py
+petstore_api/models/special_model_name.py
+petstore_api/models/special_name.py
+petstore_api/models/tag.py
+petstore_api/models/user.py
+petstore_api/models/with_nested_one_of.py
+petstore_api/rest.py
+petstore_api/signing.py
+requirements.txt
+setup.cfg
+setup.py
+test-requirements.txt
+test/__init__.py
diff --git a/samples/openapi3/client/petstore/python-nextgen/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-nextgen/.openapi-generator/VERSION
new file mode 100755
index 00000000000..d6b4ec4aa78
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/.openapi-generator/VERSION
@@ -0,0 +1 @@
+6.3.0-SNAPSHOT
\ No newline at end of file
diff --git a/samples/openapi3/client/petstore/python-nextgen/.travis.yml b/samples/openapi3/client/petstore/python-nextgen/.travis.yml
new file mode 100755
index 00000000000..bb28138c5b1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/.travis.yml
@@ -0,0 +1,17 @@
+# ref: https://docs.travis-ci.com/user/languages/python
+language: python
+python:
+ - "3.7"
+ - "3.8"
+ - "3.9"
+ - "3.10"
+ - "3.11"
+ # uncomment the following if needed
+ #- "3.11-dev" # 3.11 development branch
+ #- "nightly" # nightly build
+# command to install dependencies
+install:
+ - "pip install -r requirements.txt"
+ - "pip install -r test-requirements.txt"
+# command to run tests
+script: pytest --cov=petstore_api
diff --git a/samples/openapi3/client/petstore/python-nextgen/Makefile b/samples/openapi3/client/petstore/python-nextgen/Makefile
new file mode 100755
index 00000000000..739b5874745
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/Makefile
@@ -0,0 +1,21 @@
+ #!/bin/bash
+
+REQUIREMENTS_FILE=dev-requirements.txt
+REQUIREMENTS_OUT=dev-requirements.txt.log
+SETUP_OUT=*.egg-info
+VENV=.venv
+
+clean:
+ rm -rf $(REQUIREMENTS_OUT)
+ rm -rf $(SETUP_OUT)
+ rm -rf $(VENV)
+ rm -rf .tox
+ rm -rf .coverage
+ find . -name "*.py[oc]" -delete
+ find . -name "__pycache__" -delete
+
+test: clean
+ bash ./test_python3.sh
+
+test-all: clean
+ bash ./test_python3.sh
diff --git a/samples/openapi3/client/petstore/python-nextgen/README.md b/samples/openapi3/client/petstore/python-nextgen/README.md
new file mode 100755
index 00000000000..80a7b39c45c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/README.md
@@ -0,0 +1,232 @@
+# petstore-api
+This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: 1.0.0
+- Package version: 1.0.0
+- Build package: org.openapitools.codegen.languages.PythonNextgenClientCodegen
+
+## Requirements.
+
+Python 3.7+
+
+## Installation & Usage
+### pip install
+
+If the python package is hosted on a repository, you can install directly using:
+
+```sh
+pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
+```
+(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
+
+Then import the package:
+```python
+import petstore_api
+```
+
+### Setuptools
+
+Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
+
+```sh
+python setup.py install --user
+```
+(or `sudo python setup.py install` to install the package for all users)
+
+Then import the package:
+```python
+import petstore_api
+```
+
+## Getting Started
+
+Please follow the [installation procedure](#installation--usage) and then run the following:
+
+```python
+from __future__ import print_function
+import datetime
+import time
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.AnotherFakeApi(api_client)
+ client = petstore_api.Client() # Client | client model
+
+ try:
+ # To test special tags
+ api_response = api_instance.call_123_test_special_tags(client)
+ print("The response of AnotherFakeApi->call_123_test_special_tags:\n")
+ pprint(api_response)
+ except ApiException as e:
+ print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
+
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
+*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo |
+*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
+*FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication
+*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
+*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
+*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
+*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
+*FakeApi* | [**fake_property_enum_integer_serialize**](docs/FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int |
+*FakeApi* | [**test_body_with_binary**](docs/FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary |
+*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
+*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
+*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
+*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
+*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
+*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
+*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters |
+*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case
+*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
+*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
+*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
+*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
+*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
+*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
+*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
+*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
+*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
+*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
+*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID
+*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
+*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user
+*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array
+*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array
+*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user
+*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name
+*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system
+*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session
+*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user
+
+
+## Documentation For Models
+
+ - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
+ - [AllOfWithSingleRef](docs/AllOfWithSingleRef.md)
+ - [Animal](docs/Animal.md)
+ - [AnyOfPig](docs/AnyOfPig.md)
+ - [ApiResponse](docs/ApiResponse.md)
+ - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
+ - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
+ - [ArrayTest](docs/ArrayTest.md)
+ - [BasquePig](docs/BasquePig.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)
+ - [DanishPig](docs/DanishPig.md)
+ - [DeprecatedObject](docs/DeprecatedObject.md)
+ - [Dog](docs/Dog.md)
+ - [DogAllOf](docs/DogAllOf.md)
+ - [DummyModel](docs/DummyModel.md)
+ - [EnumArrays](docs/EnumArrays.md)
+ - [EnumClass](docs/EnumClass.md)
+ - [EnumTest](docs/EnumTest.md)
+ - [File](docs/File.md)
+ - [FileSchemaTestClass](docs/FileSchemaTestClass.md)
+ - [Foo](docs/Foo.md)
+ - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md)
+ - [FormatTest](docs/FormatTest.md)
+ - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
+ - [HealthCheckResult](docs/HealthCheckResult.md)
+ - [List](docs/List.md)
+ - [MapTest](docs/MapTest.md)
+ - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
+ - [Model200Response](docs/Model200Response.md)
+ - [ModelReturn](docs/ModelReturn.md)
+ - [Name](docs/Name.md)
+ - [NullableClass](docs/NullableClass.md)
+ - [NumberOnly](docs/NumberOnly.md)
+ - [ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md)
+ - [Order](docs/Order.md)
+ - [OuterComposite](docs/OuterComposite.md)
+ - [OuterEnum](docs/OuterEnum.md)
+ - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md)
+ - [OuterEnumInteger](docs/OuterEnumInteger.md)
+ - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
+ - [OuterObjectWithEnumProperty](docs/OuterObjectWithEnumProperty.md)
+ - [Pet](docs/Pet.md)
+ - [Pig](docs/Pig.md)
+ - [ReadOnlyFirst](docs/ReadOnlyFirst.md)
+ - [SelfReferenceModel](docs/SelfReferenceModel.md)
+ - [SingleRefType](docs/SingleRefType.md)
+ - [SpecialModelName](docs/SpecialModelName.md)
+ - [SpecialName](docs/SpecialName.md)
+ - [Tag](docs/Tag.md)
+ - [User](docs/User.md)
+ - [WithNestedOneOf](docs/WithNestedOneOf.md)
+
+
+## Documentation For Authorization
+
+
+## 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
+
+
+## bearer_test
+
+- **Type**: Bearer authentication (JWT)
+
+
+## http_basic_test
+
+- **Type**: HTTP basic authentication
+
+
+## http_signature_test
+
+
+
+## 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
+
+
+## Author
+
+
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/dev-requirements.txt b/samples/openapi3/client/petstore/python-nextgen/dev-requirements.txt
new file mode 100755
index 00000000000..ccdfca62949
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/dev-requirements.txt
@@ -0,0 +1,2 @@
+tox
+flake8
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-nextgen/docs/AdditionalPropertiesClass.md
new file mode 100755
index 00000000000..6abc3136b9c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/AdditionalPropertiesClass.md
@@ -0,0 +1,29 @@
+# AdditionalPropertiesClass
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**map_property** | **Dict[str, str]** | | [optional]
+**map_of_map_property** | **Dict[str, Dict[str, str]]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AdditionalPropertiesClass from a JSON string
+additional_properties_class_instance = AdditionalPropertiesClass.from_json(json)
+# print the JSON string representation of the object
+print AdditionalPropertiesClass.to_json()
+
+# convert the object into a dict
+additional_properties_class_dict = additional_properties_class_instance.to_dict()
+# create an instance of AdditionalPropertiesClass from a dict
+additional_properties_class_form_dict = additional_properties_class.from_dict(additional_properties_class_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/python-nextgen/docs/AllOfWithSingleRef.md
new file mode 100644
index 00000000000..1a8b4df7ecc
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/AllOfWithSingleRef.md
@@ -0,0 +1,29 @@
+# AllOfWithSingleRef
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**username** | **str** | | [optional]
+**single_ref_type** | [**SingleRefType**](SingleRefType.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AllOfWithSingleRef from a JSON string
+all_of_with_single_ref_instance = AllOfWithSingleRef.from_json(json)
+# print the JSON string representation of the object
+print AllOfWithSingleRef.to_json()
+
+# convert the object into a dict
+all_of_with_single_ref_dict = all_of_with_single_ref_instance.to_dict()
+# create an instance of AllOfWithSingleRef from a dict
+all_of_with_single_ref_form_dict = all_of_with_single_ref.from_dict(all_of_with_single_ref_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/Animal.md b/samples/openapi3/client/petstore/python-nextgen/docs/Animal.md
new file mode 100755
index 00000000000..b62f1969099
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/Animal.md
@@ -0,0 +1,29 @@
+# Animal
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
+**color** | **str** | | [optional] [default to 'red']
+
+## Example
+
+```python
+from petstore_api.models.animal import Animal
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Animal from a JSON string
+animal_instance = Animal.from_json(json)
+# print the JSON string representation of the object
+print Animal.to_json()
+
+# convert the object into a dict
+animal_dict = animal_instance.to_dict()
+# create an instance of Animal from a dict
+animal_form_dict = animal.from_dict(animal_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-nextgen/docs/AnotherFakeApi.md
new file mode 100755
index 00000000000..b97da84dfbe
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/AnotherFakeApi.md
@@ -0,0 +1,73 @@
+# petstore_api.AnotherFakeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
+
+
+# **call_123_test_special_tags**
+> Client call_123_test_special_tags(client)
+
+To test special tags
+
+To test special tags and operation ID starting with number
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.AnotherFakeApi(api_client)
+ client = petstore_api.Client() # Client | client model
+
+ try:
+ # To test special tags
+ api_response = api_instance.call_123_test_special_tags(client)
+ print("The response of AnotherFakeApi->call_123_test_special_tags:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **client** | [**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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/AnyOfPig.md b/samples/openapi3/client/petstore/python-nextgen/docs/AnyOfPig.md
new file mode 100644
index 00000000000..2da7ca6eefe
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/AnyOfPig.md
@@ -0,0 +1,30 @@
+# AnyOfPig
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
+**color** | **str** | |
+**size** | **int** | |
+
+## Example
+
+```python
+from petstore_api.models.any_of_pig import AnyOfPig
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AnyOfPig from a JSON string
+any_of_pig_instance = AnyOfPig.from_json(json)
+# print the JSON string representation of the object
+print AnyOfPig.to_json()
+
+# convert the object into a dict
+any_of_pig_dict = any_of_pig_instance.to_dict()
+# create an instance of AnyOfPig from a dict
+any_of_pig_form_dict = any_of_pig.from_dict(any_of_pig_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/ApiResponse.md b/samples/openapi3/client/petstore/python-nextgen/docs/ApiResponse.md
new file mode 100755
index 00000000000..ba35ea9e2f0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/ApiResponse.md
@@ -0,0 +1,30 @@
+# ApiResponse
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **int** | | [optional]
+**type** | **str** | | [optional]
+**message** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.api_response import ApiResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ApiResponse from a JSON string
+api_response_instance = ApiResponse.from_json(json)
+# print the JSON string representation of the object
+print ApiResponse.to_json()
+
+# convert the object into a dict
+api_response_dict = api_response_instance.to_dict()
+# create an instance of ApiResponse from a dict
+api_response_form_dict = api_response.from_dict(api_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-nextgen/docs/ArrayOfArrayOfNumberOnly.md
new file mode 100755
index 00000000000..3f0c127d4fa
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/ArrayOfArrayOfNumberOnly.md
@@ -0,0 +1,28 @@
+# ArrayOfArrayOfNumberOnly
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**array_array_number** | **List[List[float]]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ArrayOfArrayOfNumberOnly from a JSON string
+array_of_array_of_number_only_instance = ArrayOfArrayOfNumberOnly.from_json(json)
+# print the JSON string representation of the object
+print ArrayOfArrayOfNumberOnly.to_json()
+
+# convert the object into a dict
+array_of_array_of_number_only_dict = array_of_array_of_number_only_instance.to_dict()
+# create an instance of ArrayOfArrayOfNumberOnly from a dict
+array_of_array_of_number_only_form_dict = array_of_array_of_number_only.from_dict(array_of_array_of_number_only_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-nextgen/docs/ArrayOfNumberOnly.md
new file mode 100755
index 00000000000..c10191915a7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/ArrayOfNumberOnly.md
@@ -0,0 +1,28 @@
+# ArrayOfNumberOnly
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**array_number** | **List[float]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ArrayOfNumberOnly from a JSON string
+array_of_number_only_instance = ArrayOfNumberOnly.from_json(json)
+# print the JSON string representation of the object
+print ArrayOfNumberOnly.to_json()
+
+# convert the object into a dict
+array_of_number_only_dict = array_of_number_only_instance.to_dict()
+# create an instance of ArrayOfNumberOnly from a dict
+array_of_number_only_form_dict = array_of_number_only.from_dict(array_of_number_only_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-nextgen/docs/ArrayTest.md
new file mode 100755
index 00000000000..0a40fb36d26
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/ArrayTest.md
@@ -0,0 +1,30 @@
+# ArrayTest
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**array_of_string** | **List[str]** | | [optional]
+**array_array_of_integer** | **List[List[int]]** | | [optional]
+**array_array_of_model** | **List[List[ReadOnlyFirst]]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.array_test import ArrayTest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ArrayTest from a JSON string
+array_test_instance = ArrayTest.from_json(json)
+# print the JSON string representation of the object
+print ArrayTest.to_json()
+
+# convert the object into a dict
+array_test_dict = array_test_instance.to_dict()
+# create an instance of ArrayTest from a dict
+array_test_form_dict = array_test.from_dict(array_test_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/BasquePig.md b/samples/openapi3/client/petstore/python-nextgen/docs/BasquePig.md
new file mode 100644
index 00000000000..552b9390c7e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/BasquePig.md
@@ -0,0 +1,29 @@
+# BasquePig
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
+**color** | **str** | |
+
+## Example
+
+```python
+from petstore_api.models.basque_pig import BasquePig
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of BasquePig from a JSON string
+basque_pig_instance = BasquePig.from_json(json)
+# print the JSON string representation of the object
+print BasquePig.to_json()
+
+# convert the object into a dict
+basque_pig_dict = basque_pig_instance.to_dict()
+# create an instance of BasquePig from a dict
+basque_pig_form_dict = basque_pig.from_dict(basque_pig_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/Capitalization.md b/samples/openapi3/client/petstore/python-nextgen/docs/Capitalization.md
new file mode 100755
index 00000000000..99e6fae88fd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/Capitalization.md
@@ -0,0 +1,33 @@
+# Capitalization
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**small_camel** | **str** | | [optional]
+**capital_camel** | **str** | | [optional]
+**small_snake** | **str** | | [optional]
+**capital_snake** | **str** | | [optional]
+**sca_eth_flow_points** | **str** | | [optional]
+**att_name** | **str** | Name of the pet | [optional]
+
+## Example
+
+```python
+from petstore_api.models.capitalization import Capitalization
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Capitalization from a JSON string
+capitalization_instance = Capitalization.from_json(json)
+# print the JSON string representation of the object
+print Capitalization.to_json()
+
+# convert the object into a dict
+capitalization_dict = capitalization_instance.to_dict()
+# create an instance of Capitalization from a dict
+capitalization_form_dict = capitalization.from_dict(capitalization_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/Cat.md b/samples/openapi3/client/petstore/python-nextgen/docs/Cat.md
new file mode 100755
index 00000000000..4b509dda7ea
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/Cat.md
@@ -0,0 +1,28 @@
+# Cat
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**declawed** | **bool** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.cat import Cat
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Cat from a JSON string
+cat_instance = Cat.from_json(json)
+# print the JSON string representation of the object
+print Cat.to_json()
+
+# convert the object into a dict
+cat_dict = cat_instance.to_dict()
+# create an instance of Cat from a dict
+cat_form_dict = cat.from_dict(cat_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/CatAllOf.md b/samples/openapi3/client/petstore/python-nextgen/docs/CatAllOf.md
new file mode 100755
index 00000000000..dcae5facb94
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/CatAllOf.md
@@ -0,0 +1,28 @@
+# CatAllOf
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**declawed** | **bool** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.cat_all_of import CatAllOf
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CatAllOf from a JSON string
+cat_all_of_instance = CatAllOf.from_json(json)
+# print the JSON string representation of the object
+print CatAllOf.to_json()
+
+# convert the object into a dict
+cat_all_of_dict = cat_all_of_instance.to_dict()
+# create an instance of CatAllOf from a dict
+cat_all_of_form_dict = cat_all_of.from_dict(cat_all_of_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/Category.md b/samples/openapi3/client/petstore/python-nextgen/docs/Category.md
new file mode 100755
index 00000000000..c49514ef802
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/Category.md
@@ -0,0 +1,29 @@
+# Category
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**name** | **str** | | [default to 'default-name']
+
+## Example
+
+```python
+from petstore_api.models.category import Category
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Category from a JSON string
+category_instance = Category.from_json(json)
+# print the JSON string representation of the object
+print Category.to_json()
+
+# convert the object into a dict
+category_dict = category_instance.to_dict()
+# create an instance of Category from a dict
+category_form_dict = category.from_dict(category_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/ClassModel.md b/samples/openapi3/client/petstore/python-nextgen/docs/ClassModel.md
new file mode 100755
index 00000000000..1b6fb7cfc77
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/ClassModel.md
@@ -0,0 +1,29 @@
+# ClassModel
+
+Model for testing model with \"_class\" property
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**var_class** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.class_model import ClassModel
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ClassModel from a JSON string
+class_model_instance = ClassModel.from_json(json)
+# print the JSON string representation of the object
+print ClassModel.to_json()
+
+# convert the object into a dict
+class_model_dict = class_model_instance.to_dict()
+# create an instance of ClassModel from a dict
+class_model_form_dict = class_model.from_dict(class_model_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/Client.md b/samples/openapi3/client/petstore/python-nextgen/docs/Client.md
new file mode 100755
index 00000000000..b0ded10dd76
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/Client.md
@@ -0,0 +1,28 @@
+# Client
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**client** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.client import Client
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Client from a JSON string
+client_instance = Client.from_json(json)
+# print the JSON string representation of the object
+print Client.to_json()
+
+# convert the object into a dict
+client_dict = client_instance.to_dict()
+# create an instance of Client from a dict
+client_form_dict = client.from_dict(client_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/DanishPig.md b/samples/openapi3/client/petstore/python-nextgen/docs/DanishPig.md
new file mode 100644
index 00000000000..253616c2fc3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/DanishPig.md
@@ -0,0 +1,29 @@
+# DanishPig
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
+**size** | **int** | |
+
+## Example
+
+```python
+from petstore_api.models.danish_pig import DanishPig
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DanishPig from a JSON string
+danish_pig_instance = DanishPig.from_json(json)
+# print the JSON string representation of the object
+print DanishPig.to_json()
+
+# convert the object into a dict
+danish_pig_dict = danish_pig_instance.to_dict()
+# create an instance of DanishPig from a dict
+danish_pig_form_dict = danish_pig.from_dict(danish_pig_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-nextgen/docs/DefaultApi.md
new file mode 100755
index 00000000000..d81c9dd7a92
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/DefaultApi.md
@@ -0,0 +1,66 @@
+# petstore_api.DefaultApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**foo_get**](DefaultApi.md#foo_get) | **GET** /foo |
+
+
+# **foo_get**
+> FooGetDefaultResponse foo_get()
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.DefaultApi(api_client)
+
+ try:
+ api_response = api_instance.foo_get()
+ print("The response of DefaultApi->foo_get:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling DefaultApi->foo_get: %s\n" % e)
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**FooGetDefaultResponse**](FooGetDefaultResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**0** | response | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/DeprecatedObject.md b/samples/openapi3/client/petstore/python-nextgen/docs/DeprecatedObject.md
new file mode 100644
index 00000000000..e6cf5718963
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/DeprecatedObject.md
@@ -0,0 +1,28 @@
+# DeprecatedObject
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.deprecated_object import DeprecatedObject
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DeprecatedObject from a JSON string
+deprecated_object_instance = DeprecatedObject.from_json(json)
+# print the JSON string representation of the object
+print DeprecatedObject.to_json()
+
+# convert the object into a dict
+deprecated_object_dict = deprecated_object_instance.to_dict()
+# create an instance of DeprecatedObject from a dict
+deprecated_object_form_dict = deprecated_object.from_dict(deprecated_object_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/Dog.md b/samples/openapi3/client/petstore/python-nextgen/docs/Dog.md
new file mode 100755
index 00000000000..3469be73a76
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/Dog.md
@@ -0,0 +1,28 @@
+# Dog
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**breed** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.dog import Dog
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Dog from a JSON string
+dog_instance = Dog.from_json(json)
+# print the JSON string representation of the object
+print Dog.to_json()
+
+# convert the object into a dict
+dog_dict = dog_instance.to_dict()
+# create an instance of Dog from a dict
+dog_form_dict = dog.from_dict(dog_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/DogAllOf.md b/samples/openapi3/client/petstore/python-nextgen/docs/DogAllOf.md
new file mode 100755
index 00000000000..759bdd781b0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/DogAllOf.md
@@ -0,0 +1,28 @@
+# DogAllOf
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**breed** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.dog_all_of import DogAllOf
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DogAllOf from a JSON string
+dog_all_of_instance = DogAllOf.from_json(json)
+# print the JSON string representation of the object
+print DogAllOf.to_json()
+
+# convert the object into a dict
+dog_all_of_dict = dog_all_of_instance.to_dict()
+# create an instance of DogAllOf from a dict
+dog_all_of_form_dict = dog_all_of.from_dict(dog_all_of_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/DummyModel.md b/samples/openapi3/client/petstore/python-nextgen/docs/DummyModel.md
new file mode 100644
index 00000000000..e690a8874f8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/DummyModel.md
@@ -0,0 +1,29 @@
+# DummyModel
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**category** | **str** | | [optional]
+**self_ref** | [**SelfReferenceModel**](SelfReferenceModel.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.dummy_model import DummyModel
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DummyModel from a JSON string
+dummy_model_instance = DummyModel.from_json(json)
+# print the JSON string representation of the object
+print DummyModel.to_json()
+
+# convert the object into a dict
+dummy_model_dict = dummy_model_instance.to_dict()
+# create an instance of DummyModel from a dict
+dummy_model_form_dict = dummy_model.from_dict(dummy_model_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-nextgen/docs/EnumArrays.md
new file mode 100755
index 00000000000..d21f58a6608
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/EnumArrays.md
@@ -0,0 +1,29 @@
+# EnumArrays
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**just_symbol** | **str** | | [optional]
+**array_enum** | **List[str]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.enum_arrays import EnumArrays
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of EnumArrays from a JSON string
+enum_arrays_instance = EnumArrays.from_json(json)
+# print the JSON string representation of the object
+print EnumArrays.to_json()
+
+# convert the object into a dict
+enum_arrays_dict = enum_arrays_instance.to_dict()
+# create an instance of EnumArrays from a dict
+enum_arrays_form_dict = enum_arrays.from_dict(enum_arrays_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/EnumClass.md b/samples/openapi3/client/petstore/python-nextgen/docs/EnumClass.md
new file mode 100755
index 00000000000..64830e3d1de
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/EnumClass.md
@@ -0,0 +1,10 @@
+# EnumClass
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/EnumTest.md b/samples/openapi3/client/petstore/python-nextgen/docs/EnumTest.md
new file mode 100755
index 00000000000..3c900769031
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/EnumTest.md
@@ -0,0 +1,35 @@
+# EnumTest
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**enum_string** | **str** | | [optional]
+**enum_string_required** | **str** | |
+**enum_integer** | **int** | | [optional]
+**enum_number** | **float** | | [optional]
+**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional]
+**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional]
+**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional]
+**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.enum_test import EnumTest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of EnumTest from a JSON string
+enum_test_instance = EnumTest.from_json(json)
+# print the JSON string representation of the object
+print EnumTest.to_json()
+
+# convert the object into a dict
+enum_test_dict = enum_test_instance.to_dict()
+# create an instance of EnumTest from a dict
+enum_test_form_dict = enum_test.from_dict(enum_test_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/FakeApi.md b/samples/openapi3/client/petstore/python-nextgen/docs/FakeApi.md
new file mode 100755
index 00000000000..191b1ab4676
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/FakeApi.md
@@ -0,0 +1,1153 @@
+# petstore_api.FakeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
+[**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication
+[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
+[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
+[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
+[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
+[**fake_property_enum_integer_serialize**](FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int |
+[**test_body_with_binary**](FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary |
+[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
+[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
+[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
+[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
+[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
+[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
+[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters |
+
+
+# **fake_health_get**
+> HealthCheckResult fake_health_get()
+
+Health check endpoint
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+
+ try:
+ # Health check endpoint
+ api_response = api_instance.fake_health_get()
+ print("The response of FakeApi->fake_health_get:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_health_get: %s\n" % e)
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**HealthCheckResult**](HealthCheckResult.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | The instance started successfully | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_http_signature_test**
+> fake_http_signature_test(pet, query_1=query_1, header_1=header_1)
+
+test http signature authentication
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+ query_1 = 'query_1_example' # str | query parameter (optional)
+ header_1 = 'header_1_example' # str | header parameter (optional)
+
+ try:
+ # test http signature authentication
+ api_instance.fake_http_signature_test(pet, query_1=query_1, header_1=header_1)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_http_signature_test: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+ **query_1** | **str**| query parameter | [optional]
+ **header_1** | **str**| header parameter | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | The instance started successfully | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_outer_boolean_serialize**
+> bool fake_outer_boolean_serialize(body=body)
+
+
+
+Test serialization of outer boolean types
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ body = True # bool | Input boolean as post body (optional)
+
+ try:
+ api_response = api_instance.fake_outer_boolean_serialize(body=body)
+ print("The response of FakeApi->fake_outer_boolean_serialize:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **bool**| Input boolean as post body | [optional]
+
+### Return type
+
+**bool**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output boolean | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_outer_composite_serialize**
+> OuterComposite fake_outer_composite_serialize(outer_composite=outer_composite)
+
+
+
+Test serialization of object with outer number type
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ outer_composite = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional)
+
+ try:
+ api_response = api_instance.fake_outer_composite_serialize(outer_composite=outer_composite)
+ print("The response of FakeApi->fake_outer_composite_serialize:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
+
+### Return type
+
+[**OuterComposite**](OuterComposite.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output composite | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_outer_number_serialize**
+> float fake_outer_number_serialize(body=body)
+
+
+
+Test serialization of outer number types
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ body = 3.4 # float | Input number as post body (optional)
+
+ try:
+ api_response = api_instance.fake_outer_number_serialize(body=body)
+ print("The response of FakeApi->fake_outer_number_serialize:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **float**| Input number as post body | [optional]
+
+### Return type
+
+**float**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output number | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_outer_string_serialize**
+> str fake_outer_string_serialize(body=body)
+
+
+
+Test serialization of outer string types
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ body = 'body_example' # str | Input string as post body (optional)
+
+ try:
+ api_response = api_instance.fake_outer_string_serialize(body=body)
+ print("The response of FakeApi->fake_outer_string_serialize:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **str**| Input string as post body | [optional]
+
+### Return type
+
+**str**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output string | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_property_enum_integer_serialize**
+> OuterObjectWithEnumProperty fake_property_enum_integer_serialize(outer_object_with_enum_property)
+
+
+
+Test serialization of enum (int) properties with examples
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ outer_object_with_enum_property = petstore_api.OuterObjectWithEnumProperty() # OuterObjectWithEnumProperty | Input enum (int) as post body
+
+ try:
+ api_response = api_instance.fake_property_enum_integer_serialize(outer_object_with_enum_property)
+ print("The response of FakeApi->fake_property_enum_integer_serialize:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_property_enum_integer_serialize: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **outer_object_with_enum_property** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body |
+
+### Return type
+
+[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output enum (int) | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_body_with_binary**
+> test_body_with_binary(body)
+
+
+
+For this test, the body has to be a binary file.
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ body = 'body_example' # str | image to upload
+
+ try:
+ api_instance.test_body_with_binary(body)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_body_with_binary: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **str**| image to upload |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: image/png
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_body_with_file_schema**
+> test_body_with_file_schema(file_schema_test_class)
+
+
+
+For this test, the body for this request must reference a schema named `File`.
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ file_schema_test_class = petstore_api.FileSchemaTestClass() # FileSchemaTestClass |
+
+ try:
+ api_instance.test_body_with_file_schema(file_schema_test_class)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_body_with_query_params**
+> test_body_with_query_params(query, user)
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ query = 'query_example' # str |
+ user = petstore_api.User() # User |
+
+ try:
+ api_instance.test_body_with_query_params(query, user)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **query** | **str**| |
+ **user** | [**User**](User.md)| |
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_client_model**
+> Client test_client_model(client)
+
+To test \"client\" model
+
+To test \"client\" model
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ client = petstore_api.Client() # Client | client model
+
+ try:
+ # To test \"client\" model
+ api_response = api_instance.test_client_model(client)
+ print("The response of FakeApi->test_client_model:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_client_model: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **client** | [**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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_endpoint_parameters**
+> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, var_date=var_date, date_time=date_time, password=password, param_callback=param_callback)
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+### Example
+
+* Basic Authentication (http_basic_test):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: http_basic_test
+configuration = petstore_api.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ number = 3.4 # float | None
+ double = 3.4 # float | None
+ pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None
+ byte = 'byte_example' # str | None
+ integer = 56 # int | None (optional)
+ int32 = 56 # int | None (optional)
+ int64 = 56 # int | None (optional)
+ float = 3.4 # float | None (optional)
+ string = 'string_example' # str | None (optional)
+ binary = 'binary_example' # str | None (optional)
+ var_date = '2013-10-20' # date | None (optional)
+ date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional)
+ password = 'password_example' # str | None (optional)
+ param_callback = 'param_callback_example' # str | None (optional)
+
+ try:
+ # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, var_date=var_date, date_time=date_time, password=password, param_callback=param_callback)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **number** | **float**| None |
+ **double** | **float**| None |
+ **pattern_without_delimiter** | **str**| None |
+ **byte** | **str**| None |
+ **integer** | **int**| None | [optional]
+ **int32** | **int**| None | [optional]
+ **int64** | **int**| None | [optional]
+ **float** | **float**| None | [optional]
+ **string** | **str**| None | [optional]
+ **binary** | **str**| None | [optional]
+ **var_date** | **date**| None | [optional]
+ **date_time** | **datetime**| None | [optional]
+ **password** | **str**| None | [optional]
+ **param_callback** | **str**| None | [optional]
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_group_parameters**
+> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
+
+Fake endpoint to test group parameters (optional)
+
+Fake endpoint to test group parameters (optional)
+
+### Example
+
+* Bearer (JWT) Authentication (bearer_test):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure Bearer authorization (JWT): bearer_test
+configuration = petstore_api.Configuration(
+ access_token = os.environ["BEARER_TOKEN"]
+)
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ required_string_group = 56 # int | Required String in group parameters
+ required_boolean_group = True # bool | Required Boolean in group parameters
+ required_int64_group = 56 # int | Required Integer in group parameters
+ string_group = 56 # int | String in group parameters (optional)
+ boolean_group = True # bool | Boolean in group parameters (optional)
+ int64_group = 56 # int | Integer in group parameters (optional)
+
+ try:
+ # Fake endpoint to test group parameters (optional)
+ api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **required_string_group** | **int**| Required String in group parameters |
+ **required_boolean_group** | **bool**| Required Boolean in group parameters |
+ **required_int64_group** | **int**| Required Integer in group parameters |
+ **string_group** | **int**| String in group parameters | [optional]
+ **boolean_group** | **bool**| Boolean in group parameters | [optional]
+ **int64_group** | **int**| Integer in group parameters | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[bearer_test](../README.md#bearer_test)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**400** | Someting wrong | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_inline_additional_properties**
+> test_inline_additional_properties(request_body)
+
+test inline additionalProperties
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ request_body = {'key': 'request_body_example'} # Dict[str, str] | request body
+
+ try:
+ # test inline additionalProperties
+ api_instance.test_inline_additional_properties(request_body)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **request_body** | [**Dict[str, str]**](str.md)| request body |
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_json_form_data**
+> test_json_form_data(param, param2)
+
+test json serialization of form data
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ param = 'param_example' # str | field1
+ param2 = 'param2_example' # str | field2
+
+ try:
+ # test json serialization of form data
+ api_instance.test_json_form_data(param, param2)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_json_form_data: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **param** | **str**| field1 |
+ **param2** | **str**| field2 |
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_query_parameter_collection_format**
+> test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language=language)
+
+
+
+To test the collection format in query parameters
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ pipe = ['pipe_example'] # List[str] |
+ ioutil = ['ioutil_example'] # List[str] |
+ http = ['http_example'] # List[str] |
+ url = ['url_example'] # List[str] |
+ context = ['context_example'] # List[str] |
+ allow_empty = 'allow_empty_example' # str |
+ language = {'key': 'language_example'} # Dict[str, str] | (optional)
+
+ try:
+ api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language=language)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pipe** | [**List[str]**](str.md)| |
+ **ioutil** | [**List[str]**](str.md)| |
+ **http** | [**List[str]**](str.md)| |
+ **url** | [**List[str]**](str.md)| |
+ **context** | [**List[str]**](str.md)| |
+ **allow_empty** | **str**| |
+ **language** | [**Dict[str, str]**](str.md)| | [optional]
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-nextgen/docs/FakeClassnameTags123Api.md
new file mode 100755
index 00000000000..0c428b8ac26
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/FakeClassnameTags123Api.md
@@ -0,0 +1,84 @@
+# petstore_api.FakeClassnameTags123Api
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case
+
+
+# **test_classname**
+> Client test_classname(client)
+
+To test class name in snake case
+
+To test class name in snake case
+
+### Example
+
+* Api Key Authentication (api_key_query):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure API key authorization: api_key_query
+configuration.api_key['api_key_query'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['api_key_query'] = 'Bearer'
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeClassnameTags123Api(api_client)
+ client = petstore_api.Client() # Client | client model
+
+ try:
+ # To test class name in snake case
+ api_response = api_instance.test_classname(client)
+ print("The response of FakeClassnameTags123Api->test_classname:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **client** | [**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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/File.md b/samples/openapi3/client/petstore/python-nextgen/docs/File.md
new file mode 100755
index 00000000000..586da8e3255
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/File.md
@@ -0,0 +1,29 @@
+# File
+
+Must be named `File` for test.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**source_uri** | **str** | Test capitalization | [optional]
+
+## Example
+
+```python
+from petstore_api.models.file import File
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of File from a JSON string
+file_instance = File.from_json(json)
+# print the JSON string representation of the object
+print File.to_json()
+
+# convert the object into a dict
+file_dict = file_instance.to_dict()
+# create an instance of File from a dict
+file_form_dict = file.from_dict(file_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-nextgen/docs/FileSchemaTestClass.md
new file mode 100755
index 00000000000..fb967a8d992
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/FileSchemaTestClass.md
@@ -0,0 +1,29 @@
+# FileSchemaTestClass
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**file** | [**File**](File.md) | | [optional]
+**files** | [**List[File]**](File.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of FileSchemaTestClass from a JSON string
+file_schema_test_class_instance = FileSchemaTestClass.from_json(json)
+# print the JSON string representation of the object
+print FileSchemaTestClass.to_json()
+
+# convert the object into a dict
+file_schema_test_class_dict = file_schema_test_class_instance.to_dict()
+# create an instance of FileSchemaTestClass from a dict
+file_schema_test_class_form_dict = file_schema_test_class.from_dict(file_schema_test_class_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/Foo.md b/samples/openapi3/client/petstore/python-nextgen/docs/Foo.md
new file mode 100755
index 00000000000..8062d08df1d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/Foo.md
@@ -0,0 +1,28 @@
+# Foo
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **str** | | [optional] [default to 'bar']
+
+## Example
+
+```python
+from petstore_api.models.foo import Foo
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Foo from a JSON string
+foo_instance = Foo.from_json(json)
+# print the JSON string representation of the object
+print Foo.to_json()
+
+# convert the object into a dict
+foo_dict = foo_instance.to_dict()
+# create an instance of Foo from a dict
+foo_form_dict = foo.from_dict(foo_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/python-nextgen/docs/FooGetDefaultResponse.md
new file mode 100644
index 00000000000..550fbe78fa1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/FooGetDefaultResponse.md
@@ -0,0 +1,28 @@
+# FooGetDefaultResponse
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**string** | [**Foo**](Foo.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of FooGetDefaultResponse from a JSON string
+foo_get_default_response_instance = FooGetDefaultResponse.from_json(json)
+# print the JSON string representation of the object
+print FooGetDefaultResponse.to_json()
+
+# convert the object into a dict
+foo_get_default_response_dict = foo_get_default_response_instance.to_dict()
+# create an instance of FooGetDefaultResponse from a dict
+foo_get_default_response_form_dict = foo_get_default_response.from_dict(foo_get_default_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/FormatTest.md b/samples/openapi3/client/petstore/python-nextgen/docs/FormatTest.md
new file mode 100755
index 00000000000..e42fa1ea019
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/FormatTest.md
@@ -0,0 +1,43 @@
+# FormatTest
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**integer** | **int** | | [optional]
+**int32** | **int** | | [optional]
+**int64** | **int** | | [optional]
+**number** | **float** | |
+**float** | **float** | | [optional]
+**double** | **float** | | [optional]
+**decimal** | **decimal.Decimal** | | [optional]
+**string** | **str** | | [optional]
+**byte** | **str** | |
+**binary** | **str** | | [optional]
+**var_date** | **date** | |
+**date_time** | **datetime** | | [optional]
+**uuid** | **str** | | [optional]
+**password** | **str** | |
+**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional]
+**pattern_with_digits_and_delimiter** | **str** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
+
+## Example
+
+```python
+from petstore_api.models.format_test import FormatTest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of FormatTest from a JSON string
+format_test_instance = FormatTest.from_json(json)
+# print the JSON string representation of the object
+print FormatTest.to_json()
+
+# convert the object into a dict
+format_test_dict = format_test_instance.to_dict()
+# create an instance of FormatTest from a dict
+format_test_form_dict = format_test.from_dict(format_test_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-nextgen/docs/HasOnlyReadOnly.md
new file mode 100755
index 00000000000..99573bd28a2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/HasOnlyReadOnly.md
@@ -0,0 +1,29 @@
+# HasOnlyReadOnly
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **str** | | [optional] [readonly]
+**foo** | **str** | | [optional] [readonly]
+
+## Example
+
+```python
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of HasOnlyReadOnly from a JSON string
+has_only_read_only_instance = HasOnlyReadOnly.from_json(json)
+# print the JSON string representation of the object
+print HasOnlyReadOnly.to_json()
+
+# convert the object into a dict
+has_only_read_only_dict = has_only_read_only_instance.to_dict()
+# create an instance of HasOnlyReadOnly from a dict
+has_only_read_only_form_dict = has_only_read_only.from_dict(has_only_read_only_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-nextgen/docs/HealthCheckResult.md
new file mode 100755
index 00000000000..b8723e018aa
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/HealthCheckResult.md
@@ -0,0 +1,29 @@
+# HealthCheckResult
+
+Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**nullable_message** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.health_check_result import HealthCheckResult
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of HealthCheckResult from a JSON string
+health_check_result_instance = HealthCheckResult.from_json(json)
+# print the JSON string representation of the object
+print HealthCheckResult.to_json()
+
+# convert the object into a dict
+health_check_result_dict = health_check_result_instance.to_dict()
+# create an instance of HealthCheckResult from a dict
+health_check_result_form_dict = health_check_result.from_dict(health_check_result_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject.md b/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject.md
new file mode 100755
index 00000000000..f567ea188ce
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject.md
@@ -0,0 +1,11 @@
+# InlineObject
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | Updated name of the pet | [optional]
+**status** | **str** | Updated status of the pet | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject1.md b/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject1.md
new file mode 100755
index 00000000000..42d38efa301
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject1.md
@@ -0,0 +1,11 @@
+# InlineObject1
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**additional_metadata** | **str** | Additional data to pass to server | [optional]
+**file** | **file** | file to upload | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject2.md b/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject2.md
new file mode 100755
index 00000000000..9bfba12f6f1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject2.md
@@ -0,0 +1,11 @@
+# InlineObject2
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**enum_form_string_array** | **list[str]** | Form parameter enum test (string array) | [optional]
+**enum_form_string** | **str** | Form parameter enum test (string) | [optional] [default to '-efg']
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject3.md b/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject3.md
new file mode 100755
index 00000000000..ef9845fcd9c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject3.md
@@ -0,0 +1,23 @@
+# InlineObject3
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**integer** | **int** | None | [optional]
+**int32** | **int** | None | [optional]
+**int64** | **int** | None | [optional]
+**number** | **float** | None |
+**float** | **float** | None | [optional]
+**double** | **float** | None |
+**string** | **str** | None | [optional]
+**pattern_without_delimiter** | **str** | None |
+**byte** | **str** | None |
+**binary** | **file** | None | [optional]
+**date** | **date** | None | [optional]
+**date_time** | **datetime** | None | [optional]
+**password** | **str** | None | [optional]
+**callback** | **str** | None | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject4.md b/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject4.md
new file mode 100755
index 00000000000..07574d0d076
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject4.md
@@ -0,0 +1,11 @@
+# InlineObject4
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**param** | **str** | field1 |
+**param2** | **str** | field2 |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject5.md b/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject5.md
new file mode 100755
index 00000000000..c4502f70f9c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/InlineObject5.md
@@ -0,0 +1,11 @@
+# InlineObject5
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**additional_metadata** | **str** | Additional data to pass to server | [optional]
+**required_file** | **file** | file to upload |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/python-nextgen/docs/InlineResponseDefault.md
new file mode 100755
index 00000000000..f0a52bc4639
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/InlineResponseDefault.md
@@ -0,0 +1,11 @@
+# InlineResponseDefault
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**string** | [**Foo**](Foo.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/List.md b/samples/openapi3/client/petstore/python-nextgen/docs/List.md
new file mode 100755
index 00000000000..7643e4ea92d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/List.md
@@ -0,0 +1,28 @@
+# List
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**var_123_list** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.list import List
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of List from a JSON string
+list_instance = List.from_json(json)
+# print the JSON string representation of the object
+print List.to_json()
+
+# convert the object into a dict
+list_dict = list_instance.to_dict()
+# create an instance of List from a dict
+list_form_dict = list.from_dict(list_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/MapTest.md b/samples/openapi3/client/petstore/python-nextgen/docs/MapTest.md
new file mode 100755
index 00000000000..ba87758a522
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/MapTest.md
@@ -0,0 +1,31 @@
+# MapTest
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**map_map_of_string** | **Dict[str, Dict[str, str]]** | | [optional]
+**map_of_enum_string** | **Dict[str, str]** | | [optional]
+**direct_map** | **Dict[str, bool]** | | [optional]
+**indirect_map** | **Dict[str, bool]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.map_test import MapTest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MapTest from a JSON string
+map_test_instance = MapTest.from_json(json)
+# print the JSON string representation of the object
+print MapTest.to_json()
+
+# convert the object into a dict
+map_test_dict = map_test_instance.to_dict()
+# create an instance of MapTest from a dict
+map_test_form_dict = map_test.from_dict(map_test_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-nextgen/docs/MixedPropertiesAndAdditionalPropertiesClass.md
new file mode 100755
index 00000000000..8f628d133ab
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -0,0 +1,30 @@
+# MixedPropertiesAndAdditionalPropertiesClass
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uuid** | **str** | | [optional]
+**date_time** | **datetime** | | [optional]
+**map** | [**Dict[str, Animal]**](Animal.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MixedPropertiesAndAdditionalPropertiesClass from a JSON string
+mixed_properties_and_additional_properties_class_instance = MixedPropertiesAndAdditionalPropertiesClass.from_json(json)
+# print the JSON string representation of the object
+print MixedPropertiesAndAdditionalPropertiesClass.to_json()
+
+# convert the object into a dict
+mixed_properties_and_additional_properties_class_dict = mixed_properties_and_additional_properties_class_instance.to_dict()
+# create an instance of MixedPropertiesAndAdditionalPropertiesClass from a dict
+mixed_properties_and_additional_properties_class_form_dict = mixed_properties_and_additional_properties_class.from_dict(mixed_properties_and_additional_properties_class_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/Model200Response.md b/samples/openapi3/client/petstore/python-nextgen/docs/Model200Response.md
new file mode 100755
index 00000000000..6a20cefe99c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/Model200Response.md
@@ -0,0 +1,30 @@
+# Model200Response
+
+Model for testing model name starting with number
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **int** | | [optional]
+**var_class** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.model200_response import Model200Response
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Model200Response from a JSON string
+model200_response_instance = Model200Response.from_json(json)
+# print the JSON string representation of the object
+print Model200Response.to_json()
+
+# convert the object into a dict
+model200_response_dict = model200_response_instance.to_dict()
+# create an instance of Model200Response from a dict
+model200_response_form_dict = model200_response.from_dict(model200_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-nextgen/docs/ModelReturn.md
new file mode 100755
index 00000000000..a5b47f423c8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/ModelReturn.md
@@ -0,0 +1,29 @@
+# ModelReturn
+
+Model for testing reserved words
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**var_return** | **int** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.model_return import ModelReturn
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ModelReturn from a JSON string
+model_return_instance = ModelReturn.from_json(json)
+# print the JSON string representation of the object
+print ModelReturn.to_json()
+
+# convert the object into a dict
+model_return_dict = model_return_instance.to_dict()
+# create an instance of ModelReturn from a dict
+model_return_form_dict = model_return.from_dict(model_return_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/Model_200Response.md b/samples/openapi3/client/petstore/python-nextgen/docs/Model_200Response.md
new file mode 100644
index 00000000000..4fd119d1251
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/Model_200Response.md
@@ -0,0 +1,13 @@
+# Model_200Response
+
+Model for testing model name starting with number
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **int** | | [optional]
+**_class** | **str** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/Model_Return.md b/samples/openapi3/client/petstore/python-nextgen/docs/Model_Return.md
new file mode 100644
index 00000000000..674c441551b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/Model_Return.md
@@ -0,0 +1,12 @@
+# Model_Return
+
+Model for testing reserved words
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**_return** | **int** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/Name.md b/samples/openapi3/client/petstore/python-nextgen/docs/Name.md
new file mode 100755
index 00000000000..4ccd0ce09aa
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/Name.md
@@ -0,0 +1,32 @@
+# Name
+
+Model for testing model name same as property name
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **int** | |
+**snake_case** | **int** | | [optional] [readonly]
+**var_property** | **str** | | [optional]
+**var_123_number** | **int** | | [optional] [readonly]
+
+## Example
+
+```python
+from petstore_api.models.name import Name
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Name from a JSON string
+name_instance = Name.from_json(json)
+# print the JSON string representation of the object
+print Name.to_json()
+
+# convert the object into a dict
+name_dict = name_instance.to_dict()
+# create an instance of Name from a dict
+name_form_dict = name.from_dict(name_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/NestedOneOf.md b/samples/openapi3/client/petstore/python-nextgen/docs/NestedOneOf.md
new file mode 100644
index 00000000000..913192432e7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/NestedOneOf.md
@@ -0,0 +1,12 @@
+# NestedOneOf
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**size** | **int** | | [optional]
+**nested_pig** | [**Pig**](Pig.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/NullableClass.md b/samples/openapi3/client/petstore/python-nextgen/docs/NullableClass.md
new file mode 100755
index 00000000000..1658756b50e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/NullableClass.md
@@ -0,0 +1,40 @@
+# NullableClass
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**required_integer_prop** | **int** | |
+**integer_prop** | **int** | | [optional]
+**number_prop** | **float** | | [optional]
+**boolean_prop** | **bool** | | [optional]
+**string_prop** | **str** | | [optional]
+**date_prop** | **date** | | [optional]
+**datetime_prop** | **datetime** | | [optional]
+**array_nullable_prop** | **List[object]** | | [optional]
+**array_and_items_nullable_prop** | **List[object]** | | [optional]
+**array_items_nullable** | **List[object]** | | [optional]
+**object_nullable_prop** | **Dict[str, object]** | | [optional]
+**object_and_items_nullable_prop** | **Dict[str, object]** | | [optional]
+**object_items_nullable** | **Dict[str, object]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.nullable_class import NullableClass
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of NullableClass from a JSON string
+nullable_class_instance = NullableClass.from_json(json)
+# print the JSON string representation of the object
+print NullableClass.to_json()
+
+# convert the object into a dict
+nullable_class_dict = nullable_class_instance.to_dict()
+# create an instance of NullableClass from a dict
+nullable_class_form_dict = nullable_class.from_dict(nullable_class_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-nextgen/docs/NumberOnly.md
new file mode 100755
index 00000000000..f49216ddaa4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/NumberOnly.md
@@ -0,0 +1,28 @@
+# NumberOnly
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**just_number** | **float** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.number_only import NumberOnly
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of NumberOnly from a JSON string
+number_only_instance = NumberOnly.from_json(json)
+# print the JSON string representation of the object
+print NumberOnly.to_json()
+
+# convert the object into a dict
+number_only_dict = number_only_instance.to_dict()
+# create an instance of NumberOnly from a dict
+number_only_form_dict = number_only.from_dict(number_only_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/python-nextgen/docs/ObjectWithDeprecatedFields.md
new file mode 100644
index 00000000000..8daa55a3916
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/ObjectWithDeprecatedFields.md
@@ -0,0 +1,31 @@
+# ObjectWithDeprecatedFields
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uuid** | **str** | | [optional]
+**id** | **float** | | [optional]
+**deprecated_ref** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional]
+**bars** | **List[str]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ObjectWithDeprecatedFields from a JSON string
+object_with_deprecated_fields_instance = ObjectWithDeprecatedFields.from_json(json)
+# print the JSON string representation of the object
+print ObjectWithDeprecatedFields.to_json()
+
+# convert the object into a dict
+object_with_deprecated_fields_dict = object_with_deprecated_fields_instance.to_dict()
+# create an instance of ObjectWithDeprecatedFields from a dict
+object_with_deprecated_fields_form_dict = object_with_deprecated_fields.from_dict(object_with_deprecated_fields_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/Order.md b/samples/openapi3/client/petstore/python-nextgen/docs/Order.md
new file mode 100755
index 00000000000..e71e955a11d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/Order.md
@@ -0,0 +1,33 @@
+# Order
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**pet_id** | **int** | | [optional]
+**quantity** | **int** | | [optional]
+**ship_date** | **datetime** | | [optional]
+**status** | **str** | Order Status | [optional]
+**complete** | **bool** | | [optional] [default to False]
+
+## Example
+
+```python
+from petstore_api.models.order import Order
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Order from a JSON string
+order_instance = Order.from_json(json)
+# print the JSON string representation of the object
+print Order.to_json()
+
+# convert the object into a dict
+order_dict = order_instance.to_dict()
+# create an instance of Order from a dict
+order_form_dict = order.from_dict(order_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/OuterComposite.md b/samples/openapi3/client/petstore/python-nextgen/docs/OuterComposite.md
new file mode 100755
index 00000000000..504e266f9a1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/OuterComposite.md
@@ -0,0 +1,30 @@
+# OuterComposite
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**my_number** | **float** | | [optional]
+**my_string** | **str** | | [optional]
+**my_boolean** | **bool** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.outer_composite import OuterComposite
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of OuterComposite from a JSON string
+outer_composite_instance = OuterComposite.from_json(json)
+# print the JSON string representation of the object
+print OuterComposite.to_json()
+
+# convert the object into a dict
+outer_composite_dict = outer_composite_instance.to_dict()
+# create an instance of OuterComposite from a dict
+outer_composite_form_dict = outer_composite.from_dict(outer_composite_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/OuterEnum.md b/samples/openapi3/client/petstore/python-nextgen/docs/OuterEnum.md
new file mode 100755
index 00000000000..4cb31437c7e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/OuterEnum.md
@@ -0,0 +1,10 @@
+# OuterEnum
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/python-nextgen/docs/OuterEnumDefaultValue.md
new file mode 100755
index 00000000000..4a5ba6428d8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/OuterEnumDefaultValue.md
@@ -0,0 +1,10 @@
+# OuterEnumDefaultValue
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/python-nextgen/docs/OuterEnumInteger.md
new file mode 100755
index 00000000000..fc84ec36585
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/OuterEnumInteger.md
@@ -0,0 +1,10 @@
+# OuterEnumInteger
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/python-nextgen/docs/OuterEnumIntegerDefaultValue.md
new file mode 100755
index 00000000000..0de4199a840
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/OuterEnumIntegerDefaultValue.md
@@ -0,0 +1,10 @@
+# OuterEnumIntegerDefaultValue
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/python-nextgen/docs/OuterObjectWithEnumProperty.md
new file mode 100644
index 00000000000..c6a1cdcbc19
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/OuterObjectWithEnumProperty.md
@@ -0,0 +1,29 @@
+# OuterObjectWithEnumProperty
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**str_value** | [**OuterEnum**](OuterEnum.md) | | [optional]
+**value** | [**OuterEnumInteger**](OuterEnumInteger.md) | |
+
+## Example
+
+```python
+from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of OuterObjectWithEnumProperty from a JSON string
+outer_object_with_enum_property_instance = OuterObjectWithEnumProperty.from_json(json)
+# print the JSON string representation of the object
+print OuterObjectWithEnumProperty.to_json()
+
+# convert the object into a dict
+outer_object_with_enum_property_dict = outer_object_with_enum_property_instance.to_dict()
+# create an instance of OuterObjectWithEnumProperty from a dict
+outer_object_with_enum_property_form_dict = outer_object_with_enum_property.from_dict(outer_object_with_enum_property_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/Pet.md b/samples/openapi3/client/petstore/python-nextgen/docs/Pet.md
new file mode 100755
index 00000000000..05a466f880a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/Pet.md
@@ -0,0 +1,33 @@
+# Pet
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**category** | [**Category**](Category.md) | | [optional]
+**name** | **str** | |
+**photo_urls** | **List[str]** | |
+**tags** | [**List[Tag]**](Tag.md) | | [optional]
+**status** | **str** | pet status in the store | [optional]
+
+## Example
+
+```python
+from petstore_api.models.pet import Pet
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Pet from a JSON string
+pet_instance = Pet.from_json(json)
+# print the JSON string representation of the object
+print Pet.to_json()
+
+# convert the object into a dict
+pet_dict = pet_instance.to_dict()
+# create an instance of Pet from a dict
+pet_form_dict = pet.from_dict(pet_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/PetApi.md b/samples/openapi3/client/petstore/python-nextgen/docs/PetApi.md
new file mode 100755
index 00000000000..f3a1d7446dc
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/PetApi.md
@@ -0,0 +1,1292 @@
+# petstore_api.PetApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
+[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
+[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
+[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
+[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
+[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
+[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
+[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
+[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+
+
+# **add_pet**
+> add_pet(pet)
+
+Add a new pet to the store
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+
+ try:
+ # Add a new pet to the store
+ api_instance.add_pet(pet)
+ except Exception as e:
+ print("Exception when calling PetApi->add_pet: %s\n" % e)
+```
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+
+ try:
+ # Add a new pet to the store
+ api_instance.add_pet(pet)
+ except Exception as e:
+ print("Exception when calling PetApi->add_pet: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test), [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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **delete_pet**
+> delete_pet(pet_id, api_key=api_key)
+
+Deletes a pet
+
+
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | Pet id to delete
+ api_key = 'api_key_example' # str | (optional)
+
+ try:
+ # Deletes a pet
+ api_instance.delete_pet(pet_id, api_key=api_key)
+ except Exception as e:
+ print("Exception when calling PetApi->delete_pet: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| Pet id to delete |
+ **api_key** | **str**| | [optional]
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **find_pets_by_status**
+> List[Pet] find_pets_by_status(status)
+
+Finds Pets by status
+
+Multiple status values can be provided with comma separated strings
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ status = ['status_example'] # List[str] | Status values that need to be considered for filter
+
+ try:
+ # Finds Pets by status
+ api_response = api_instance.find_pets_by_status(status)
+ print("The response of PetApi->find_pets_by_status:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->find_pets_by_status: %s\n" % e)
+```
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ status = ['status_example'] # List[str] | Status values that need to be considered for filter
+
+ try:
+ # Finds Pets by status
+ api_response = api_instance.find_pets_by_status(status)
+ print("The response of PetApi->find_pets_by_status:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->find_pets_by_status: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | [**List[str]**](str.md)| Status values that need to be considered for filter |
+
+### Return type
+
+[**List[Pet]**](Pet.md)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test), [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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **find_pets_by_tags**
+> List[Pet] find_pets_by_tags(tags)
+
+Finds Pets by tags
+
+Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ tags = ['tags_example'] # List[str] | Tags to filter by
+
+ try:
+ # Finds Pets by tags
+ api_response = api_instance.find_pets_by_tags(tags)
+ print("The response of PetApi->find_pets_by_tags:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e)
+```
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ tags = ['tags_example'] # List[str] | Tags to filter by
+
+ try:
+ # Finds Pets by tags
+ api_response = api_instance.find_pets_by_tags(tags)
+ print("The response of PetApi->find_pets_by_tags:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **tags** | [**List[str]**](str.md)| Tags to filter by |
+
+### Return type
+
+[**List[Pet]**](Pet.md)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test), [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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_pet_by_id**
+> Pet get_pet_by_id(pet_id)
+
+Find pet by ID
+
+Returns a single pet
+
+### Example
+
+* Api Key Authentication (api_key):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure API key authorization: api_key
+configuration.api_key['api_key'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['api_key'] = 'Bearer'
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet to return
+
+ try:
+ # Find pet by ID
+ api_response = api_instance.get_pet_by_id(pet_id)
+ print("The response of PetApi->get_pet_by_id:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->get_pet_by_id: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| 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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **update_pet**
+> update_pet(pet)
+
+Update an existing pet
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+
+ try:
+ # Update an existing pet
+ api_instance.update_pet(pet)
+ except Exception as e:
+ print("Exception when calling PetApi->update_pet: %s\n" % e)
+```
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+
+ try:
+ # Update an existing pet
+ api_instance.update_pet(pet)
+ except Exception as e:
+ print("Exception when calling PetApi->update_pet: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test), [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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **update_pet_with_form**
+> update_pet_with_form(pet_id, name=name, status=status)
+
+Updates a pet in the store with form data
+
+
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet that needs to be updated
+ name = 'name_example' # str | Updated name of the pet (optional)
+ status = 'status_example' # str | Updated status of the pet (optional)
+
+ try:
+ # Updates a pet in the store with form data
+ api_instance.update_pet_with_form(pet_id, name=name, status=status)
+ except Exception as e:
+ print("Exception when calling PetApi->update_pet_with_form: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| ID of pet that needs to be updated |
+ **name** | **str**| Updated name of the pet | [optional]
+ **status** | **str**| Updated status of the pet | [optional]
+
+### Return type
+
+void (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 |
+|-------------|-------------|------------------|
+**200** | Successful operation | - |
+**405** | Invalid input | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **upload_file**
+> ApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file)
+
+uploads an image
+
+
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet to update
+ additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
+ file = 'file_example' # str | file to upload (optional)
+
+ try:
+ # uploads an image
+ api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file)
+ print("The response of PetApi->upload_file:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->upload_file: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| ID of pet to update |
+ **additional_metadata** | **str**| Additional data to pass to server | [optional]
+ **file** | **str**| file to upload | [optional]
+
+### Return type
+
+[**ApiResponse**](ApiResponse.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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **upload_file_with_required_file**
+> ApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
+
+uploads an image (required)
+
+
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet to update
+ required_file = 'required_file_example' # str | file to upload
+ additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
+
+ try:
+ # uploads an image (required)
+ api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
+ print("The response of PetApi->upload_file_with_required_file:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| ID of pet to update |
+ **required_file** | **str**| file to upload |
+ **additional_metadata** | **str**| Additional data to pass to server | [optional]
+
+### Return type
+
+[**ApiResponse**](ApiResponse.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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/Pig.md b/samples/openapi3/client/petstore/python-nextgen/docs/Pig.md
new file mode 100644
index 00000000000..398d6c6c6e3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/Pig.md
@@ -0,0 +1,30 @@
+# Pig
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
+**color** | **str** | |
+**size** | **int** | |
+
+## Example
+
+```python
+from petstore_api.models.pig import Pig
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Pig from a JSON string
+pig_instance = Pig.from_json(json)
+# print the JSON string representation of the object
+print Pig.to_json()
+
+# convert the object into a dict
+pig_dict = pig_instance.to_dict()
+# create an instance of Pig from a dict
+pig_form_dict = pig.from_dict(pig_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-nextgen/docs/ReadOnlyFirst.md
new file mode 100755
index 00000000000..22b5acca70c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/ReadOnlyFirst.md
@@ -0,0 +1,29 @@
+# ReadOnlyFirst
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **str** | | [optional] [readonly]
+**baz** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.read_only_first import ReadOnlyFirst
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ReadOnlyFirst from a JSON string
+read_only_first_instance = ReadOnlyFirst.from_json(json)
+# print the JSON string representation of the object
+print ReadOnlyFirst.to_json()
+
+# convert the object into a dict
+read_only_first_dict = read_only_first_instance.to_dict()
+# create an instance of ReadOnlyFirst from a dict
+read_only_first_form_dict = read_only_first.from_dict(read_only_first_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/SelfReferenceModel.md b/samples/openapi3/client/petstore/python-nextgen/docs/SelfReferenceModel.md
new file mode 100644
index 00000000000..dbf9589d576
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/SelfReferenceModel.md
@@ -0,0 +1,29 @@
+# SelfReferenceModel
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**size** | **int** | | [optional]
+**nested** | [**DummyModel**](DummyModel.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.self_reference_model import SelfReferenceModel
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of SelfReferenceModel from a JSON string
+self_reference_model_instance = SelfReferenceModel.from_json(json)
+# print the JSON string representation of the object
+print SelfReferenceModel.to_json()
+
+# convert the object into a dict
+self_reference_model_dict = self_reference_model_instance.to_dict()
+# create an instance of SelfReferenceModel from a dict
+self_reference_model_form_dict = self_reference_model.from_dict(self_reference_model_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/SingleRefType.md b/samples/openapi3/client/petstore/python-nextgen/docs/SingleRefType.md
new file mode 100644
index 00000000000..4178ac3b505
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/SingleRefType.md
@@ -0,0 +1,10 @@
+# SingleRefType
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-nextgen/docs/SpecialModelName.md
new file mode 100755
index 00000000000..3d27640abb0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/SpecialModelName.md
@@ -0,0 +1,28 @@
+# SpecialModelName
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**special_property_name** | **int** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.special_model_name import SpecialModelName
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of SpecialModelName from a JSON string
+special_model_name_instance = SpecialModelName.from_json(json)
+# print the JSON string representation of the object
+print SpecialModelName.to_json()
+
+# convert the object into a dict
+special_model_name_dict = special_model_name_instance.to_dict()
+# create an instance of SpecialModelName from a dict
+special_model_name_form_dict = special_model_name.from_dict(special_model_name_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/SpecialName.md b/samples/openapi3/client/petstore/python-nextgen/docs/SpecialName.md
new file mode 100644
index 00000000000..0b412952597
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/SpecialName.md
@@ -0,0 +1,30 @@
+# SpecialName
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**var_property** | **int** | | [optional]
+**var_async** | [**Category**](Category.md) | | [optional]
+**var_schema** | **str** | pet status in the store | [optional]
+
+## Example
+
+```python
+from petstore_api.models.special_name import SpecialName
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of SpecialName from a JSON string
+special_name_instance = SpecialName.from_json(json)
+# print the JSON string representation of the object
+print SpecialName.to_json()
+
+# convert the object into a dict
+special_name_dict = special_name_instance.to_dict()
+# create an instance of SpecialName from a dict
+special_name_form_dict = special_name.from_dict(special_name_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/StoreApi.md b/samples/openapi3/client/petstore/python-nextgen/docs/StoreApi.md
new file mode 100755
index 00000000000..6c1b3c12661
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/StoreApi.md
@@ -0,0 +1,277 @@
+# petstore_api.StoreApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
+[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
+[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID
+[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
+
+
+# **delete_order**
+> delete_order(order_id)
+
+Delete purchase order by ID
+
+For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.StoreApi(api_client)
+ order_id = 'order_id_example' # str | ID of the order that needs to be deleted
+
+ try:
+ # Delete purchase order by ID
+ api_instance.delete_order(order_id)
+ except Exception as e:
+ print("Exception when calling StoreApi->delete_order: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **order_id** | **str**| ID of the order that needs to be deleted |
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_inventory**
+> Dict[str, int] get_inventory()
+
+Returns pet inventories by status
+
+Returns a map of status codes to quantities
+
+### Example
+
+* Api Key Authentication (api_key):
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure API key authorization: api_key
+configuration.api_key['api_key'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['api_key'] = 'Bearer'
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.StoreApi(api_client)
+
+ try:
+ # Returns pet inventories by status
+ api_response = api_instance.get_inventory()
+ print("The response of StoreApi->get_inventory:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling StoreApi->get_inventory: %s\n" % e)
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+**Dict[str, int]**
+
+### 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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_order_by_id**
+> Order get_order_by_id(order_id)
+
+Find purchase order by ID
+
+For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.StoreApi(api_client)
+ order_id = 56 # int | ID of pet that needs to be fetched
+
+ try:
+ # Find purchase order by ID
+ api_response = api_instance.get_order_by_id(order_id)
+ print("The response of StoreApi->get_order_by_id:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling StoreApi->get_order_by_id: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **order_id** | **int**| 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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **place_order**
+> Order place_order(order)
+
+Place an order for a pet
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.StoreApi(api_client)
+ order = petstore_api.Order() # Order | order placed for purchasing the pet
+
+ try:
+ # Place an order for a pet
+ api_response = api_instance.place_order(order)
+ print("The response of StoreApi->place_order:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling StoreApi->place_order: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **order** | [**Order**](Order.md)| order placed for purchasing the pet |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid Order | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/Tag.md b/samples/openapi3/client/petstore/python-nextgen/docs/Tag.md
new file mode 100755
index 00000000000..e680c68bedd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/Tag.md
@@ -0,0 +1,29 @@
+# Tag
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**name** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.tag import Tag
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Tag from a JSON string
+tag_instance = Tag.from_json(json)
+# print the JSON string representation of the object
+print Tag.to_json()
+
+# convert the object into a dict
+tag_dict = tag_instance.to_dict()
+# create an instance of Tag from a dict
+tag_form_dict = tag.from_dict(tag_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/User.md b/samples/openapi3/client/petstore/python-nextgen/docs/User.md
new file mode 100755
index 00000000000..6d7c357ea86
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/User.md
@@ -0,0 +1,35 @@
+# User
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**username** | **str** | | [optional]
+**first_name** | **str** | | [optional]
+**last_name** | **str** | | [optional]
+**email** | **str** | | [optional]
+**password** | **str** | | [optional]
+**phone** | **str** | | [optional]
+**user_status** | **int** | User Status | [optional]
+
+## Example
+
+```python
+from petstore_api.models.user import User
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of User from a JSON string
+user_instance = User.from_json(json)
+# print the JSON string representation of the object
+print User.to_json()
+
+# convert the object into a dict
+user_dict = user_instance.to_dict()
+# create an instance of User from a dict
+user_form_dict = user.from_dict(user_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/UserApi.md b/samples/openapi3/client/petstore/python-nextgen/docs/UserApi.md
new file mode 100755
index 00000000000..723ddf83ab7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/UserApi.md
@@ -0,0 +1,521 @@
+# petstore_api.UserApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**create_user**](UserApi.md#create_user) | **POST** /user | Create user
+[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array
+[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array
+[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user
+[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name
+[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system
+[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session
+[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user
+
+
+# **create_user**
+> create_user(user)
+
+Create user
+
+This can only be done by the logged in user.
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ user = petstore_api.User() # User | Created user object
+
+ try:
+ # Create user
+ api_instance.create_user(user)
+ except Exception as e:
+ print("Exception when calling UserApi->create_user: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**User**](User.md)| Created user object |
+
+### Return type
+
+void (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 |
+|-------------|-------------|------------------|
+**0** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **create_users_with_array_input**
+> create_users_with_array_input(user)
+
+Creates list of users with given input array
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ user = [petstore_api.User()] # List[User] | List of user object
+
+ try:
+ # Creates list of users with given input array
+ api_instance.create_users_with_array_input(user)
+ except Exception as e:
+ print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**List[User]**](User.md)| List of user object |
+
+### Return type
+
+void (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 |
+|-------------|-------------|------------------|
+**0** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **create_users_with_list_input**
+> create_users_with_list_input(user)
+
+Creates list of users with given input array
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ user = [petstore_api.User()] # List[User] | List of user object
+
+ try:
+ # Creates list of users with given input array
+ api_instance.create_users_with_list_input(user)
+ except Exception as e:
+ print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**List[User]**](User.md)| List of user object |
+
+### Return type
+
+void (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 |
+|-------------|-------------|------------------|
+**0** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **delete_user**
+> delete_user(username)
+
+Delete user
+
+This can only be done by the logged in user.
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | The name that needs to be deleted
+
+ try:
+ # Delete user
+ api_instance.delete_user(username)
+ except Exception as e:
+ print("Exception when calling UserApi->delete_user: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **str**| The name that needs to be deleted |
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_user_by_name**
+> User get_user_by_name(username)
+
+Get user by user name
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing.
+
+ try:
+ # Get user by user name
+ api_response = api_instance.get_user_by_name(username)
+ print("The response of UserApi->get_user_by_name:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling UserApi->get_user_by_name: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **str**| 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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **login_user**
+> str login_user(username, password)
+
+Logs user into the system
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | The user name for login
+ password = 'password_example' # str | The password for login in clear text
+
+ try:
+ # Logs user into the system
+ api_response = api_instance.login_user(username, password)
+ print("The response of UserApi->login_user:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling UserApi->login_user: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **str**| The user name for login |
+ **password** | **str**| The password for login in clear text |
+
+### Return type
+
+**str**
+
+### 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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **logout_user**
+> logout_user()
+
+Logs out current logged in user session
+
+
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+
+ try:
+ # Logs out current logged in user session
+ api_instance.logout_user()
+ except Exception as e:
+ print("Exception when calling UserApi->logout_user: %s\n" % e)
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+void (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 | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **update_user**
+> update_user(username, user)
+
+Updated user
+
+This can only be done by the logged in user.
+
+### Example
+
+```python
+from __future__ import print_function
+import time
+import os
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient() as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | name that need to be deleted
+ user = petstore_api.User() # User | Updated user object
+
+ try:
+ # Updated user
+ api_instance.update_user(username, user)
+ except Exception as e:
+ print("Exception when calling UserApi->update_user: %s\n" % e)
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **str**| name that need to be deleted |
+ **user** | [**User**](User.md)| Updated user object |
+
+### Return type
+
+void (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 |
+|-------------|-------------|------------------|
+**400** | Invalid user supplied | - |
+**404** | User not found | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/WithNestedOneOf.md b/samples/openapi3/client/petstore/python-nextgen/docs/WithNestedOneOf.md
new file mode 100644
index 00000000000..b6211ba9194
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/docs/WithNestedOneOf.md
@@ -0,0 +1,29 @@
+# WithNestedOneOf
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**size** | **int** | | [optional]
+**nested_pig** | [**Pig**](Pig.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.with_nested_one_of import WithNestedOneOf
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of WithNestedOneOf from a JSON string
+with_nested_one_of_instance = WithNestedOneOf.from_json(json)
+# print the JSON string representation of the object
+print WithNestedOneOf.to_json()
+
+# convert the object into a dict
+with_nested_one_of_dict = with_nested_one_of_instance.to_dict()
+# create an instance of WithNestedOneOf from a dict
+with_nested_one_of_form_dict = with_nested_one_of.from_dict(with_nested_one_of_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/git_push.sh b/samples/openapi3/client/petstore/python-nextgen/git_push.sh
new file mode 100755
index 00000000000..f53a75d4fab
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/git_push.sh
@@ -0,0 +1,57 @@
+#!/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-petstore-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/openapi3/client/petstore/python-nextgen/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/__init__.py
new file mode 100755
index 00000000000..6bc4148a4e1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/__init__.py
@@ -0,0 +1,93 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+__version__ = "1.0.0"
+
+# import apis into sdk package
+from petstore_api.api.another_fake_api import AnotherFakeApi
+from petstore_api.api.default_api import DefaultApi
+from petstore_api.api.fake_api import FakeApi
+from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api
+from petstore_api.api.pet_api import PetApi
+from petstore_api.api.store_api import StoreApi
+from petstore_api.api.user_api import UserApi
+
+# import ApiClient
+from petstore_api.api_client import ApiClient
+from petstore_api.configuration import Configuration
+from petstore_api.exceptions import OpenApiException
+from petstore_api.exceptions import ApiTypeError
+from petstore_api.exceptions import ApiValueError
+from petstore_api.exceptions import ApiKeyError
+from petstore_api.exceptions import ApiAttributeError
+from petstore_api.exceptions import ApiException
+# import models into sdk package
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
+from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
+from petstore_api.models.animal import Animal
+from petstore_api.models.any_of_pig import AnyOfPig
+from petstore_api.models.api_response import ApiResponse
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
+from petstore_api.models.array_test import ArrayTest
+from petstore_api.models.basque_pig import BasquePig
+from petstore_api.models.capitalization import Capitalization
+from petstore_api.models.cat import Cat
+from petstore_api.models.cat_all_of import CatAllOf
+from petstore_api.models.category import Category
+from petstore_api.models.class_model import ClassModel
+from petstore_api.models.client import Client
+from petstore_api.models.danish_pig import DanishPig
+from petstore_api.models.deprecated_object import DeprecatedObject
+from petstore_api.models.dog import Dog
+from petstore_api.models.dog_all_of import DogAllOf
+from petstore_api.models.dummy_model import DummyModel
+from petstore_api.models.enum_arrays import EnumArrays
+from petstore_api.models.enum_class import EnumClass
+from petstore_api.models.enum_test import EnumTest
+from petstore_api.models.file import File
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+from petstore_api.models.foo import Foo
+from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
+from petstore_api.models.format_test import FormatTest
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly
+from petstore_api.models.health_check_result import HealthCheckResult
+from petstore_api.models.list import List
+from petstore_api.models.map_test import MapTest
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+from petstore_api.models.model200_response import Model200Response
+from petstore_api.models.model_return import ModelReturn
+from petstore_api.models.name import Name
+from petstore_api.models.nullable_class import NullableClass
+from petstore_api.models.number_only import NumberOnly
+from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields
+from petstore_api.models.order import Order
+from petstore_api.models.outer_composite import OuterComposite
+from petstore_api.models.outer_enum import OuterEnum
+from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue
+from petstore_api.models.outer_enum_integer import OuterEnumInteger
+from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
+from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
+from petstore_api.models.pet import Pet
+from petstore_api.models.pig import Pig
+from petstore_api.models.read_only_first import ReadOnlyFirst
+from petstore_api.models.self_reference_model import SelfReferenceModel
+from petstore_api.models.single_ref_type import SingleRefType
+from petstore_api.models.special_model_name import SpecialModelName
+from petstore_api.models.special_name import SpecialName
+from petstore_api.models.tag import Tag
+from petstore_api.models.user import User
+from petstore_api.models.with_nested_one_of import WithNestedOneOf
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/__init__.py
new file mode 100755
index 00000000000..bc45197c40f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/__init__.py
@@ -0,0 +1,12 @@
+from __future__ import absolute_import
+
+# flake8: noqa
+
+# import apis into api package
+from petstore_api.api.another_fake_api import AnotherFakeApi
+from petstore_api.api.default_api import DefaultApi
+from petstore_api.api.fake_api import FakeApi
+from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api
+from petstore_api.api.pet_api import PetApi
+from petstore_api.api.store_api import StoreApi
+from petstore_api.api.user_api import UserApi
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/another_fake_api.py
new file mode 100755
index 00000000000..c4a9c365912
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/another_fake_api.py
@@ -0,0 +1,191 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field
+
+from petstore_api.models.client import Client
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class AnotherFakeApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def call_123_test_special_tags(self, client : Annotated[Client, Field(..., description="client model")], **kwargs) -> Client: # noqa: E501
+ """To test special tags # noqa: E501
+
+ To test special tags and operation ID starting with number # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.call_123_test_special_tags(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Client
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.call_123_test_special_tags_with_http_info(client, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def call_123_test_special_tags_with_http_info(self, client : Annotated[Client, Field(..., description="client model")], **kwargs): # noqa: E501
+ """To test special tags # noqa: E501
+
+ To test special tags and operation ID starting with number # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.call_123_test_special_tags_with_http_info(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'client'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method call_123_test_special_tags" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['client']:
+ _body_params = _params['client']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "Client",
+ }
+
+ return self.api_client.call_api(
+ '/another-fake/dummy', 'PATCH',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/default_api.py
new file mode 100755
index 00000000000..b3e39a7303d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/default_api.py
@@ -0,0 +1,172 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class DefaultApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def foo_get(self, **kwargs) -> FooGetDefaultResponse: # noqa: E501
+ """foo_get # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.foo_get(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: FooGetDefaultResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.foo_get_with_http_info(**kwargs) # noqa: E501
+
+ @validate_arguments
+ def foo_get_with_http_info(self, **kwargs): # noqa: E501
+ """foo_get # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.foo_get_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(FooGetDefaultResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method foo_get" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ }
+
+ return self.api_client.call_api(
+ '/foo', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_api.py
new file mode 100755
index 00000000000..58bd69612b8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_api.py
@@ -0,0 +1,2564 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from datetime import date, datetime
+
+from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, confloat, conint, constr, validator
+
+from typing import Dict, List, Optional
+
+from petstore_api.models.client import Client
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+from petstore_api.models.health_check_result import HealthCheckResult
+from petstore_api.models.outer_composite import OuterComposite
+from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
+from petstore_api.models.pet import Pet
+from petstore_api.models.user import User
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class FakeApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def fake_health_get(self, **kwargs) -> HealthCheckResult: # noqa: E501
+ """Health check endpoint # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_health_get(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: HealthCheckResult
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_health_get_with_http_info(**kwargs) # noqa: E501
+
+ @validate_arguments
+ def fake_health_get_with_http_info(self, **kwargs): # noqa: E501
+ """Health check endpoint # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_health_get_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(HealthCheckResult, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_health_get" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "HealthCheckResult",
+ }
+
+ return self.api_client.call_api(
+ '/fake/health', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def fake_http_signature_test(self, pet : Annotated[Pet, Field(..., description="Pet object that needs to be added to the store")], query_1 : Annotated[Optional[StrictStr], Field(description="query parameter")] = None, header_1 : Annotated[Optional[StrictStr], Field(description="header parameter")] = None, **kwargs) -> None: # noqa: E501
+ """test http signature authentication # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_http_signature_test(pet, query_1, header_1, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param query_1: query parameter
+ :type query_1: str
+ :param header_1: header parameter
+ :type header_1: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_http_signature_test_with_http_info(pet, query_1, header_1, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def fake_http_signature_test_with_http_info(self, pet : Annotated[Pet, Field(..., description="Pet object that needs to be added to the store")], query_1 : Annotated[Optional[StrictStr], Field(description="query parameter")] = None, header_1 : Annotated[Optional[StrictStr], Field(description="header parameter")] = None, **kwargs): # noqa: E501
+ """test http signature authentication # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_http_signature_test_with_http_info(pet, query_1, header_1, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param query_1: query parameter
+ :type query_1: str
+ :param header_1: header parameter
+ :type header_1: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pet',
+ 'query_1',
+ 'header_1'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_http_signature_test" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('query_1') is not None: # noqa: E501
+ _query_params.append(('query_1', _params['query_1']))
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ if _params['header_1']:
+ _header_params['header_1'] = _params['header_1']
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['pet']:
+ _body_params = _params['pet']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json', 'application/xml']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['http_signature_test'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/http-signature-test', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def fake_outer_boolean_serialize(self, body : Annotated[Optional[StrictBool], Field(description="Input boolean as post body")] = None, **kwargs) -> bool: # noqa: E501
+ """fake_outer_boolean_serialize # noqa: E501
+
+ Test serialization of outer boolean types # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_outer_boolean_serialize(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input boolean as post body
+ :type body: bool
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: bool
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_outer_boolean_serialize_with_http_info(body, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def fake_outer_boolean_serialize_with_http_info(self, body : Annotated[Optional[StrictBool], Field(description="Input boolean as post body")] = None, **kwargs): # noqa: E501
+ """fake_outer_boolean_serialize # noqa: E501
+
+ Test serialization of outer boolean types # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_outer_boolean_serialize_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input boolean as post body
+ :type body: bool
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(bool, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'body'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_outer_boolean_serialize" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['body']:
+ _body_params = _params['body']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "bool",
+ }
+
+ return self.api_client.call_api(
+ '/fake/outer/boolean', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def fake_outer_composite_serialize(self, outer_composite : Annotated[Optional[OuterComposite], Field(description="Input composite as post body")] = None, **kwargs) -> OuterComposite: # noqa: E501
+ """fake_outer_composite_serialize # noqa: E501
+
+ Test serialization of object with outer number type # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_outer_composite_serialize(outer_composite, async_req=True)
+ >>> result = thread.get()
+
+ :param outer_composite: Input composite as post body
+ :type outer_composite: OuterComposite
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: OuterComposite
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_outer_composite_serialize_with_http_info(outer_composite, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def fake_outer_composite_serialize_with_http_info(self, outer_composite : Annotated[Optional[OuterComposite], Field(description="Input composite as post body")] = None, **kwargs): # noqa: E501
+ """fake_outer_composite_serialize # noqa: E501
+
+ Test serialization of object with outer number type # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_outer_composite_serialize_with_http_info(outer_composite, async_req=True)
+ >>> result = thread.get()
+
+ :param outer_composite: Input composite as post body
+ :type outer_composite: OuterComposite
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(OuterComposite, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'outer_composite'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_outer_composite_serialize" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['outer_composite']:
+ _body_params = _params['outer_composite']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "OuterComposite",
+ }
+
+ return self.api_client.call_api(
+ '/fake/outer/composite', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def fake_outer_number_serialize(self, body : Annotated[Optional[StrictFloat], Field(description="Input number as post body")] = None, **kwargs) -> float: # noqa: E501
+ """fake_outer_number_serialize # noqa: E501
+
+ Test serialization of outer number types # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_outer_number_serialize(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input number as post body
+ :type body: float
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: float
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_outer_number_serialize_with_http_info(body, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def fake_outer_number_serialize_with_http_info(self, body : Annotated[Optional[StrictFloat], Field(description="Input number as post body")] = None, **kwargs): # noqa: E501
+ """fake_outer_number_serialize # noqa: E501
+
+ Test serialization of outer number types # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_outer_number_serialize_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input number as post body
+ :type body: float
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(float, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'body'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_outer_number_serialize" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['body']:
+ _body_params = _params['body']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "float",
+ }
+
+ return self.api_client.call_api(
+ '/fake/outer/number', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def fake_outer_string_serialize(self, body : Annotated[Optional[StrictStr], Field(description="Input string as post body")] = None, **kwargs) -> str: # noqa: E501
+ """fake_outer_string_serialize # noqa: E501
+
+ Test serialization of outer string types # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_outer_string_serialize(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input string as post body
+ :type body: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: str
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_outer_string_serialize_with_http_info(body, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def fake_outer_string_serialize_with_http_info(self, body : Annotated[Optional[StrictStr], Field(description="Input string as post body")] = None, **kwargs): # noqa: E501
+ """fake_outer_string_serialize # noqa: E501
+
+ Test serialization of outer string types # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_outer_string_serialize_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: Input string as post body
+ :type body: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'body'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_outer_string_serialize" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['body']:
+ _body_params = _params['body']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "str",
+ }
+
+ return self.api_client.call_api(
+ '/fake/outer/string', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def fake_property_enum_integer_serialize(self, outer_object_with_enum_property : Annotated[OuterObjectWithEnumProperty, Field(..., description="Input enum (int) as post body")], **kwargs) -> OuterObjectWithEnumProperty: # noqa: E501
+ """fake_property_enum_integer_serialize # noqa: E501
+
+ Test serialization of enum (int) properties with examples # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_property_enum_integer_serialize(outer_object_with_enum_property, async_req=True)
+ >>> result = thread.get()
+
+ :param outer_object_with_enum_property: Input enum (int) as post body (required)
+ :type outer_object_with_enum_property: OuterObjectWithEnumProperty
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: OuterObjectWithEnumProperty
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.fake_property_enum_integer_serialize_with_http_info(outer_object_with_enum_property, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def fake_property_enum_integer_serialize_with_http_info(self, outer_object_with_enum_property : Annotated[OuterObjectWithEnumProperty, Field(..., description="Input enum (int) as post body")], **kwargs): # noqa: E501
+ """fake_property_enum_integer_serialize # noqa: E501
+
+ Test serialization of enum (int) properties with examples # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.fake_property_enum_integer_serialize_with_http_info(outer_object_with_enum_property, async_req=True)
+ >>> result = thread.get()
+
+ :param outer_object_with_enum_property: Input enum (int) as post body (required)
+ :type outer_object_with_enum_property: OuterObjectWithEnumProperty
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(OuterObjectWithEnumProperty, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'outer_object_with_enum_property'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method fake_property_enum_integer_serialize" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['outer_object_with_enum_property']:
+ _body_params = _params['outer_object_with_enum_property']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['*/*']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "OuterObjectWithEnumProperty",
+ }
+
+ return self.api_client.call_api(
+ '/fake/property/enum-int', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_body_with_binary(self, body : Annotated[Optional[StrictStr], Field(..., description="image to upload")], **kwargs) -> None: # noqa: E501
+ """test_body_with_binary # noqa: E501
+
+ For this test, the body has to be a binary file. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_body_with_binary(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: image to upload (required)
+ :type body: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_body_with_binary_with_http_info(body, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_body_with_binary_with_http_info(self, body : Annotated[Optional[StrictStr], Field(..., description="image to upload")], **kwargs): # noqa: E501
+ """test_body_with_binary # noqa: E501
+
+ For this test, the body has to be a binary file. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_body_with_binary_with_http_info(body, async_req=True)
+ >>> result = thread.get()
+
+ :param body: image to upload (required)
+ :type body: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'body'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_body_with_binary" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['body']:
+ _body_params = _params['body']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['image/png']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/body-with-binary', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_body_with_file_schema(self, file_schema_test_class : FileSchemaTestClass, **kwargs) -> None: # noqa: E501
+ """test_body_with_file_schema # noqa: E501
+
+ For this test, the body for this request must reference a schema named `File`. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True)
+ >>> result = thread.get()
+
+ :param file_schema_test_class: (required)
+ :type file_schema_test_class: FileSchemaTestClass
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_body_with_file_schema_with_http_info(file_schema_test_class, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_body_with_file_schema_with_http_info(self, file_schema_test_class : FileSchemaTestClass, **kwargs): # noqa: E501
+ """test_body_with_file_schema # noqa: E501
+
+ For this test, the body for this request must reference a schema named `File`. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_body_with_file_schema_with_http_info(file_schema_test_class, async_req=True)
+ >>> result = thread.get()
+
+ :param file_schema_test_class: (required)
+ :type file_schema_test_class: FileSchemaTestClass
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'file_schema_test_class'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_body_with_file_schema" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['file_schema_test_class']:
+ _body_params = _params['file_schema_test_class']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/body-with-file-schema', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_body_with_query_params(self, query : StrictStr, user : User, **kwargs) -> None: # noqa: E501
+ """test_body_with_query_params # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_body_with_query_params(query, user, async_req=True)
+ >>> result = thread.get()
+
+ :param query: (required)
+ :type query: str
+ :param user: (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_body_with_query_params_with_http_info(query, user, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_body_with_query_params_with_http_info(self, query : StrictStr, user : User, **kwargs): # noqa: E501
+ """test_body_with_query_params # noqa: E501
+
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_body_with_query_params_with_http_info(query, user, async_req=True)
+ >>> result = thread.get()
+
+ :param query: (required)
+ :type query: str
+ :param user: (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'query',
+ 'user'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_body_with_query_params" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('query') is not None: # noqa: E501
+ _query_params.append(('query', _params['query']))
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['user']:
+ _body_params = _params['user']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/body-with-query-params', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_client_model(self, client : Annotated[Client, Field(..., description="client model")], **kwargs) -> Client: # noqa: E501
+ """To test \"client\" model # noqa: E501
+
+ To test \"client\" model # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_client_model(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Client
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_client_model_with_http_info(client, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_client_model_with_http_info(self, client : Annotated[Client, Field(..., description="client model")], **kwargs): # noqa: E501
+ """To test \"client\" model # noqa: E501
+
+ To test \"client\" model # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_client_model_with_http_info(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'client'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_client_model" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['client']:
+ _body_params = _params['client']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "Client",
+ }
+
+ return self.api_client.call_api(
+ '/fake', 'PATCH',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_endpoint_parameters(self, number : Annotated[confloat(strict=True, ge=543.2, le=32.1), Field(..., description="None")], double : Annotated[confloat(strict=True, ge=123.4, le=67.8), Field(..., description="None")], pattern_without_delimiter : Annotated[constr(strict=True), Field(..., description="None")], byte : Annotated[StrictStr, Field(..., description="None")], integer : Annotated[Optional[conint(strict=True, ge=100, le=10)], Field(description="None")] = None, int32 : Annotated[Optional[conint(strict=True, ge=200, le=20)], Field(description="None")] = None, int64 : Annotated[Optional[StrictInt], Field(description="None")] = None, float : Annotated[Optional[confloat(strict=True, ge=987.6)], Field(description="None")] = None, string : Annotated[Optional[constr(strict=True)], Field(description="None")] = None, binary : Annotated[Optional[StrictStr], Field(description="None")] = None, var_date : Annotated[Optional[date], Field(description="None")] = None, date_time : Annotated[Optional[datetime], Field(description="None")] = None, password : Annotated[Optional[constr(strict=True, max_length=64, min_length=10)], Field(description="None")] = None, param_callback : Annotated[Optional[StrictStr], Field(description="None")] = None, **kwargs) -> None: # noqa: E501
+ """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+
+ Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, var_date, date_time, password, param_callback, async_req=True)
+ >>> result = thread.get()
+
+ :param number: None (required)
+ :type number: float
+ :param double: None (required)
+ :type double: float
+ :param pattern_without_delimiter: None (required)
+ :type pattern_without_delimiter: str
+ :param byte: None (required)
+ :type byte: str
+ :param integer: None
+ :type integer: int
+ :param int32: None
+ :type int32: int
+ :param int64: None
+ :type int64: int
+ :param float: None
+ :type float: float
+ :param string: None
+ :type string: str
+ :param binary: None
+ :type binary: str
+ :param var_date: None
+ :type var_date: date
+ :param date_time: None
+ :type date_time: datetime
+ :param password: None
+ :type password: str
+ :param param_callback: None
+ :type param_callback: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, var_date, date_time, password, param_callback, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_endpoint_parameters_with_http_info(self, number : Annotated[confloat(strict=True, ge=543.2, le=32.1), Field(..., description="None")], double : Annotated[confloat(strict=True, ge=123.4, le=67.8), Field(..., description="None")], pattern_without_delimiter : Annotated[constr(strict=True), Field(..., description="None")], byte : Annotated[StrictStr, Field(..., description="None")], integer : Annotated[Optional[conint(strict=True, ge=100, le=10)], Field(description="None")] = None, int32 : Annotated[Optional[conint(strict=True, ge=200, le=20)], Field(description="None")] = None, int64 : Annotated[Optional[StrictInt], Field(description="None")] = None, float : Annotated[Optional[confloat(strict=True, ge=987.6)], Field(description="None")] = None, string : Annotated[Optional[constr(strict=True)], Field(description="None")] = None, binary : Annotated[Optional[StrictStr], Field(description="None")] = None, var_date : Annotated[Optional[date], Field(description="None")] = None, date_time : Annotated[Optional[datetime], Field(description="None")] = None, password : Annotated[Optional[constr(strict=True, max_length=64, min_length=10)], Field(description="None")] = None, param_callback : Annotated[Optional[StrictStr], Field(description="None")] = None, **kwargs): # noqa: E501
+ """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+
+ Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, var_date, date_time, password, param_callback, async_req=True)
+ >>> result = thread.get()
+
+ :param number: None (required)
+ :type number: float
+ :param double: None (required)
+ :type double: float
+ :param pattern_without_delimiter: None (required)
+ :type pattern_without_delimiter: str
+ :param byte: None (required)
+ :type byte: str
+ :param integer: None
+ :type integer: int
+ :param int32: None
+ :type int32: int
+ :param int64: None
+ :type int64: int
+ :param float: None
+ :type float: float
+ :param string: None
+ :type string: str
+ :param binary: None
+ :type binary: str
+ :param var_date: None
+ :type var_date: date
+ :param date_time: None
+ :type date_time: datetime
+ :param password: None
+ :type password: str
+ :param param_callback: None
+ :type param_callback: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'number',
+ 'double',
+ 'pattern_without_delimiter',
+ 'byte',
+ 'integer',
+ 'int32',
+ 'int64',
+ 'float',
+ 'string',
+ 'binary',
+ 'var_date',
+ 'date_time',
+ 'password',
+ 'param_callback'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_endpoint_parameters" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ if _params['integer']:
+ _form_params.append(('integer', _params['integer']))
+ if _params['int32']:
+ _form_params.append(('int32', _params['int32']))
+ if _params['int64']:
+ _form_params.append(('int64', _params['int64']))
+ if _params['number']:
+ _form_params.append(('number', _params['number']))
+ if _params['float']:
+ _form_params.append(('float', _params['float']))
+ if _params['double']:
+ _form_params.append(('double', _params['double']))
+ if _params['string']:
+ _form_params.append(('string', _params['string']))
+ if _params['pattern_without_delimiter']:
+ _form_params.append(('pattern_without_delimiter', _params['pattern_without_delimiter']))
+ if _params['byte']:
+ _form_params.append(('byte', _params['byte']))
+ if _params['binary']:
+ _files['binary'] = _params['binary']
+ if _params['var_date']:
+ _form_params.append(('date', _params['var_date']))
+ if _params['date_time']:
+ _form_params.append(('dateTime', _params['date_time']))
+ if _params['password']:
+ _form_params.append(('password', _params['password']))
+ if _params['param_callback']:
+ _form_params.append(('callback', _params['param_callback']))
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/x-www-form-urlencoded']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['http_basic_test'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_group_parameters(self, required_string_group : Annotated[StrictInt, Field(..., description="Required String in group parameters")], required_boolean_group : Annotated[StrictBool, Field(..., description="Required Boolean in group parameters")], required_int64_group : Annotated[StrictInt, Field(..., description="Required Integer in group parameters")], string_group : Annotated[Optional[StrictInt], Field(description="String in group parameters")] = None, boolean_group : Annotated[Optional[StrictBool], Field(description="Boolean in group parameters")] = None, int64_group : Annotated[Optional[StrictInt], Field(description="Integer in group parameters")] = None, **kwargs) -> None: # noqa: E501
+ """Fake endpoint to test group parameters (optional) # noqa: E501
+
+ Fake endpoint to test group parameters (optional) # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group, boolean_group, int64_group, async_req=True)
+ >>> result = thread.get()
+
+ :param required_string_group: Required String in group parameters (required)
+ :type required_string_group: int
+ :param required_boolean_group: Required Boolean in group parameters (required)
+ :type required_boolean_group: bool
+ :param required_int64_group: Required Integer in group parameters (required)
+ :type required_int64_group: int
+ :param string_group: String in group parameters
+ :type string_group: int
+ :param boolean_group: Boolean in group parameters
+ :type boolean_group: bool
+ :param int64_group: Integer in group parameters
+ :type int64_group: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, string_group, boolean_group, int64_group, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_group_parameters_with_http_info(self, required_string_group : Annotated[StrictInt, Field(..., description="Required String in group parameters")], required_boolean_group : Annotated[StrictBool, Field(..., description="Required Boolean in group parameters")], required_int64_group : Annotated[StrictInt, Field(..., description="Required Integer in group parameters")], string_group : Annotated[Optional[StrictInt], Field(description="String in group parameters")] = None, boolean_group : Annotated[Optional[StrictBool], Field(description="Boolean in group parameters")] = None, int64_group : Annotated[Optional[StrictInt], Field(description="Integer in group parameters")] = None, **kwargs): # noqa: E501
+ """Fake endpoint to test group parameters (optional) # noqa: E501
+
+ Fake endpoint to test group parameters (optional) # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, string_group, boolean_group, int64_group, async_req=True)
+ >>> result = thread.get()
+
+ :param required_string_group: Required String in group parameters (required)
+ :type required_string_group: int
+ :param required_boolean_group: Required Boolean in group parameters (required)
+ :type required_boolean_group: bool
+ :param required_int64_group: Required Integer in group parameters (required)
+ :type required_int64_group: int
+ :param string_group: String in group parameters
+ :type string_group: int
+ :param boolean_group: Boolean in group parameters
+ :type boolean_group: bool
+ :param int64_group: Integer in group parameters
+ :type int64_group: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'required_string_group',
+ 'required_boolean_group',
+ 'required_int64_group',
+ 'string_group',
+ 'boolean_group',
+ 'int64_group'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_group_parameters" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('required_string_group') is not None: # noqa: E501
+ _query_params.append(('required_string_group', _params['required_string_group']))
+ if _params.get('required_int64_group') is not None: # noqa: E501
+ _query_params.append(('required_int64_group', _params['required_int64_group']))
+ if _params.get('string_group') is not None: # noqa: E501
+ _query_params.append(('string_group', _params['string_group']))
+ if _params.get('int64_group') is not None: # noqa: E501
+ _query_params.append(('int64_group', _params['int64_group']))
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ if _params['required_boolean_group']:
+ _header_params['required_boolean_group'] = _params['required_boolean_group']
+ if _params['boolean_group']:
+ _header_params['boolean_group'] = _params['boolean_group']
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # authentication setting
+ _auth_settings = ['bearer_test'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake', 'DELETE',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_inline_additional_properties(self, request_body : Annotated[Dict[str, StrictStr], Field(..., description="request body")], **kwargs) -> None: # noqa: E501
+ """test inline additionalProperties # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_inline_additional_properties(request_body, async_req=True)
+ >>> result = thread.get()
+
+ :param request_body: request body (required)
+ :type request_body: Dict[str, str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_inline_additional_properties_with_http_info(request_body, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_inline_additional_properties_with_http_info(self, request_body : Annotated[Dict[str, StrictStr], Field(..., description="request body")], **kwargs): # noqa: E501
+ """test inline additionalProperties # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_inline_additional_properties_with_http_info(request_body, async_req=True)
+ >>> result = thread.get()
+
+ :param request_body: request body (required)
+ :type request_body: Dict[str, str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'request_body'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_inline_additional_properties" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['request_body']:
+ _body_params = _params['request_body']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/inline-additionalProperties', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_json_form_data(self, param : Annotated[StrictStr, Field(..., description="field1")], param2 : Annotated[StrictStr, Field(..., description="field2")], **kwargs) -> None: # noqa: E501
+ """test json serialization of form data # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_json_form_data(param, param2, async_req=True)
+ >>> result = thread.get()
+
+ :param param: field1 (required)
+ :type param: str
+ :param param2: field2 (required)
+ :type param2: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_json_form_data_with_http_info(self, param : Annotated[StrictStr, Field(..., description="field1")], param2 : Annotated[StrictStr, Field(..., description="field2")], **kwargs): # noqa: E501
+ """test json serialization of form data # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True)
+ >>> result = thread.get()
+
+ :param param: field1 (required)
+ :type param: str
+ :param param2: field2 (required)
+ :type param2: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'param',
+ 'param2'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_json_form_data" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ if _params['param']:
+ _form_params.append(('param', _params['param']))
+ if _params['param2']:
+ _form_params.append(('param2', _params['param2']))
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/x-www-form-urlencoded']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/jsonFormData', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def test_query_parameter_collection_format(self, pipe : List[StrictStr], ioutil : List[StrictStr], http : List[StrictStr], url : List[StrictStr], context : List[StrictStr], allow_empty : StrictStr, language : Optional[Dict[str, StrictStr]] = None, **kwargs) -> None: # noqa: E501
+ """test_query_parameter_collection_format # noqa: E501
+
+ To test the collection format in query parameters # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language, async_req=True)
+ >>> result = thread.get()
+
+ :param pipe: (required)
+ :type pipe: List[str]
+ :param ioutil: (required)
+ :type ioutil: List[str]
+ :param http: (required)
+ :type http: List[str]
+ :param url: (required)
+ :type url: List[str]
+ :param context: (required)
+ :type context: List[str]
+ :param allow_empty: (required)
+ :type allow_empty: str
+ :param language:
+ :type language: Dict[str, str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, language, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_query_parameter_collection_format_with_http_info(self, pipe : List[StrictStr], ioutil : List[StrictStr], http : List[StrictStr], url : List[StrictStr], context : List[StrictStr], allow_empty : StrictStr, language : Optional[Dict[str, StrictStr]] = None, **kwargs): # noqa: E501
+ """test_query_parameter_collection_format # noqa: E501
+
+ To test the collection format in query parameters # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, language, async_req=True)
+ >>> result = thread.get()
+
+ :param pipe: (required)
+ :type pipe: List[str]
+ :param ioutil: (required)
+ :type ioutil: List[str]
+ :param http: (required)
+ :type http: List[str]
+ :param url: (required)
+ :type url: List[str]
+ :param context: (required)
+ :type context: List[str]
+ :param allow_empty: (required)
+ :type allow_empty: str
+ :param language:
+ :type language: Dict[str, str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pipe',
+ 'ioutil',
+ 'http',
+ 'url',
+ 'context',
+ 'allow_empty',
+ 'language'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_query_parameter_collection_format" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('pipe') is not None: # noqa: E501
+ _query_params.append(('pipe', _params['pipe']))
+ _collection_formats['pipe'] = 'pipes'
+ if _params.get('ioutil') is not None: # noqa: E501
+ _query_params.append(('ioutil', _params['ioutil']))
+ _collection_formats['ioutil'] = 'csv'
+ if _params.get('http') is not None: # noqa: E501
+ _query_params.append(('http', _params['http']))
+ _collection_formats['http'] = 'ssv'
+ if _params.get('url') is not None: # noqa: E501
+ _query_params.append(('url', _params['url']))
+ _collection_formats['url'] = 'csv'
+ if _params.get('context') is not None: # noqa: E501
+ _query_params.append(('context', _params['context']))
+ _collection_formats['context'] = 'multi'
+ if _params.get('language') is not None: # noqa: E501
+ _query_params.append(('language', _params['language']))
+ if _params.get('allow_empty') is not None: # noqa: E501
+ _query_params.append(('allowEmpty', _params['allow_empty']))
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/fake/test-query-parameters', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_classname_tags123_api.py
new file mode 100644
index 00000000000..63abc97279f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_classname_tags123_api.py
@@ -0,0 +1,191 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field
+
+from petstore_api.models.client import Client
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class FakeClassnameTags123Api(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def test_classname(self, client : Annotated[Client, Field(..., description="client model")], **kwargs) -> Client: # noqa: E501
+ """To test class name in snake case # noqa: E501
+
+ To test class name in snake case # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_classname(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Client
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_classname_with_http_info(client, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def test_classname_with_http_info(self, client : Annotated[Client, Field(..., description="client model")], **kwargs): # noqa: E501
+ """To test class name in snake case # noqa: E501
+
+ To test class name in snake case # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_classname_with_http_info(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'client'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_classname" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['client']:
+ _body_params = _params['client']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['api_key_query'] # noqa: E501
+
+ _response_types_map = {
+ '200': "Client",
+ }
+
+ return self.api_client.call_api(
+ '/fake_classname_test', 'PATCH',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_classname_tags_123_api.py
new file mode 100755
index 00000000000..05c1c8a0e4f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_classname_tags_123_api.py
@@ -0,0 +1,181 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+# python 2 and python 3 compatibility library
+import six
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class FakeClassnameTags123Api(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient()
+ self.api_client = api_client
+
+ def test_classname(self, client, **kwargs): # noqa: E501
+ """To test class name in snake case # noqa: E501
+
+ To test class name in snake case # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_classname(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Client
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.test_classname_with_http_info(client, **kwargs) # noqa: E501
+
+ def test_classname_with_http_info(self, client, **kwargs): # noqa: E501
+ """To test class name in snake case # noqa: E501
+
+ To test class name in snake case # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.test_classname_with_http_info(client, async_req=True)
+ >>> result = thread.get()
+
+ :param client: client model (required)
+ :type client: Client
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ local_var_params = locals()
+
+ all_params = [
+ 'client'
+ ]
+ all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ for key, val in six.iteritems(local_var_params['kwargs']):
+ if key not in all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method test_classname" % key
+ )
+ local_var_params[key] = val
+ del local_var_params['kwargs']
+ # verify the required parameter 'client' is set
+ if self.api_client.client_side_validation and ('client' not in local_var_params or # noqa: E501
+ local_var_params['client'] is None): # noqa: E501
+ raise ApiValueError("Missing the required parameter `client` when calling `test_classname`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+
+ query_params = []
+
+ header_params = dict(local_var_params.get('_headers', {}))
+
+ form_params = []
+ local_var_files = {}
+
+ body_params = None
+ if 'client' in local_var_params:
+ body_params = local_var_params['client']
+ # HTTP header `Accept`
+ header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # HTTP header `Content-Type`
+ header_params['Content-Type'] = local_var_params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json'],
+ 'PATCH', body_params)) # noqa: E501
+
+ # Authentication setting
+ auth_settings = ['api_key_query'] # noqa: E501
+
+ response_types_map = {
+ 200: "Client",
+ }
+
+ return self.api_client.call_api(
+ '/fake_classname_test', 'PATCH',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_types_map=response_types_map,
+ auth_settings=auth_settings,
+ async_req=local_var_params.get('async_req'),
+ _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=local_var_params.get('_preload_content', True),
+ _request_timeout=local_var_params.get('_request_timeout'),
+ collection_formats=collection_formats,
+ _request_auth=local_var_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/pet_api.py
new file mode 100755
index 00000000000..06580cfe707
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/pet_api.py
@@ -0,0 +1,1397 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictInt, StrictStr, validator
+
+from typing import List, Optional
+
+from petstore_api.models.api_response import ApiResponse
+from petstore_api.models.pet import Pet
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class PetApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def add_pet(self, pet : Annotated[Pet, Field(..., description="Pet object that needs to be added to the store")], **kwargs) -> None: # noqa: E501
+ """Add a new pet to the store # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.add_pet(pet, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.add_pet_with_http_info(pet, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def add_pet_with_http_info(self, pet : Annotated[Pet, Field(..., description="Pet object that needs to be added to the store")], **kwargs): # noqa: E501
+ """Add a new pet to the store # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.add_pet_with_http_info(pet, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pet'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method add_pet" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['pet']:
+ _body_params = _params['pet']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json', 'application/xml']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['http_signature_test', 'petstore_auth'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/pet', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def delete_pet(self, pet_id : Annotated[StrictInt, Field(..., description="Pet id to delete")], api_key : Optional[StrictStr] = None, **kwargs) -> None: # noqa: E501
+ """Deletes a pet # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_pet(pet_id, api_key, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: Pet id to delete (required)
+ :type pet_id: int
+ :param api_key:
+ :type api_key: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.delete_pet_with_http_info(pet_id, api_key, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def delete_pet_with_http_info(self, pet_id : Annotated[StrictInt, Field(..., description="Pet id to delete")], api_key : Optional[StrictStr] = None, **kwargs): # noqa: E501
+ """Deletes a pet # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_pet_with_http_info(pet_id, api_key, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: Pet id to delete (required)
+ :type pet_id: int
+ :param api_key:
+ :type api_key: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pet_id',
+ 'api_key'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method delete_pet" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['pet_id']:
+ _path_params['petId'] = _params['pet_id']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ if _params['api_key']:
+ _header_params['api_key'] = _params['api_key']
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # authentication setting
+ _auth_settings = ['petstore_auth'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/pet/{petId}', 'DELETE',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def find_pets_by_status(self, status : Annotated[List[StrictStr], Field(..., description="Status values that need to be considered for filter")], **kwargs) -> List[Pet]: # noqa: E501
+ """Finds Pets by status # noqa: E501
+
+ Multiple status values can be provided with comma separated strings # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.find_pets_by_status(status, async_req=True)
+ >>> result = thread.get()
+
+ :param status: Status values that need to be considered for filter (required)
+ :type status: List[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: List[Pet]
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def find_pets_by_status_with_http_info(self, status : Annotated[List[StrictStr], Field(..., description="Status values that need to be considered for filter")], **kwargs): # noqa: E501
+ """Finds Pets by status # noqa: E501
+
+ Multiple status values can be provided with comma separated strings # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.find_pets_by_status_with_http_info(status, async_req=True)
+ >>> result = thread.get()
+
+ :param status: Status values that need to be considered for filter (required)
+ :type status: List[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(List[Pet], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'status'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method find_pets_by_status" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('status') is not None: # noqa: E501
+ _query_params.append(('status', _params['status']))
+ _collection_formats['status'] = 'csv'
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['http_signature_test', 'petstore_auth'] # noqa: E501
+
+ _response_types_map = {
+ '200': "List[Pet]",
+ '400': None,
+ }
+
+ return self.api_client.call_api(
+ '/pet/findByStatus', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def find_pets_by_tags(self, tags : Annotated[List[StrictStr], Field(..., description="Tags to filter by", unique_items=True)], **kwargs) -> List[Pet]: # noqa: E501
+ """Finds Pets by tags # noqa: E501
+
+ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.find_pets_by_tags(tags, async_req=True)
+ >>> result = thread.get()
+
+ :param tags: Tags to filter by (required)
+ :type tags: List[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: List[Pet]
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def find_pets_by_tags_with_http_info(self, tags : Annotated[List[StrictStr], Field(..., description="Tags to filter by", unique_items=True)], **kwargs): # noqa: E501
+ """Finds Pets by tags # noqa: E501
+
+ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True)
+ >>> result = thread.get()
+
+ :param tags: Tags to filter by (required)
+ :type tags: List[str]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(List[Pet], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'tags'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method find_pets_by_tags" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('tags') is not None: # noqa: E501
+ _query_params.append(('tags', _params['tags']))
+ _collection_formats['tags'] = 'csv'
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['http_signature_test', 'petstore_auth'] # noqa: E501
+
+ _response_types_map = {
+ '200': "List[Pet]",
+ '400': None,
+ }
+
+ return self.api_client.call_api(
+ '/pet/findByTags', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def get_pet_by_id(self, pet_id : Annotated[StrictInt, Field(..., description="ID of pet to return")], **kwargs) -> Pet: # noqa: E501
+ """Find pet by ID # noqa: E501
+
+ Returns a single pet # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_pet_by_id(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to return (required)
+ :type pet_id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Pet
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_pet_by_id_with_http_info(self, pet_id : Annotated[StrictInt, Field(..., description="ID of pet to return")], **kwargs): # noqa: E501
+ """Find pet by ID # noqa: E501
+
+ Returns a single pet # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_pet_by_id_with_http_info(pet_id, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to return (required)
+ :type pet_id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Pet, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pet_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_pet_by_id" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['pet_id']:
+ _path_params['petId'] = _params['pet_id']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['api_key'] # noqa: E501
+
+ _response_types_map = {
+ '200': "Pet",
+ '400': None,
+ '404': None,
+ }
+
+ return self.api_client.call_api(
+ '/pet/{petId}', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def update_pet(self, pet : Annotated[Pet, Field(..., description="Pet object that needs to be added to the store")], **kwargs) -> None: # noqa: E501
+ """Update an existing pet # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_pet(pet, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.update_pet_with_http_info(pet, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def update_pet_with_http_info(self, pet : Annotated[Pet, Field(..., description="Pet object that needs to be added to the store")], **kwargs): # noqa: E501
+ """Update an existing pet # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_pet_with_http_info(pet, async_req=True)
+ >>> result = thread.get()
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pet'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_pet" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['pet']:
+ _body_params = _params['pet']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json', 'application/xml']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['http_signature_test', 'petstore_auth'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/pet', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def update_pet_with_form(self, pet_id : Annotated[StrictInt, Field(..., description="ID of pet that needs to be updated")], name : Annotated[Optional[StrictStr], Field(description="Updated name of the pet")] = None, status : Annotated[Optional[StrictStr], Field(description="Updated status of the pet")] = None, **kwargs) -> None: # noqa: E501
+ """Updates a pet in the store with form data # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_pet_with_form(pet_id, name, status, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet that needs to be updated (required)
+ :type pet_id: int
+ :param name: Updated name of the pet
+ :type name: str
+ :param status: Updated status of the pet
+ :type status: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.update_pet_with_form_with_http_info(pet_id, name, status, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def update_pet_with_form_with_http_info(self, pet_id : Annotated[StrictInt, Field(..., description="ID of pet that needs to be updated")], name : Annotated[Optional[StrictStr], Field(description="Updated name of the pet")] = None, status : Annotated[Optional[StrictStr], Field(description="Updated status of the pet")] = None, **kwargs): # noqa: E501
+ """Updates a pet in the store with form data # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_pet_with_form_with_http_info(pet_id, name, status, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet that needs to be updated (required)
+ :type pet_id: int
+ :param name: Updated name of the pet
+ :type name: str
+ :param status: Updated status of the pet
+ :type status: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pet_id',
+ 'name',
+ 'status'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_pet_with_form" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['pet_id']:
+ _path_params['petId'] = _params['pet_id']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ if _params['name']:
+ _form_params.append(('name', _params['name']))
+ if _params['status']:
+ _form_params.append(('status', _params['status']))
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/x-www-form-urlencoded']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['petstore_auth'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/pet/{petId}', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def upload_file(self, pet_id : Annotated[StrictInt, Field(..., description="ID of pet to update")], additional_metadata : Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None, file : Annotated[Optional[StrictStr], Field(description="file to upload")] = None, **kwargs) -> ApiResponse: # noqa: E501
+ """uploads an image # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.upload_file(pet_id, additional_metadata, file, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param file: file to upload
+ :type file: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: ApiResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.upload_file_with_http_info(pet_id, additional_metadata, file, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def upload_file_with_http_info(self, pet_id : Annotated[StrictInt, Field(..., description="ID of pet to update")], additional_metadata : Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None, file : Annotated[Optional[StrictStr], Field(description="file to upload")] = None, **kwargs): # noqa: E501
+ """uploads an image # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.upload_file_with_http_info(pet_id, additional_metadata, file, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param file: file to upload
+ :type file: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pet_id',
+ 'additional_metadata',
+ 'file'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method upload_file" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['pet_id']:
+ _path_params['petId'] = _params['pet_id']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ if _params['additional_metadata']:
+ _form_params.append(('additionalMetadata', _params['additional_metadata']))
+ if _params['file']:
+ _files['file'] = _params['file']
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['multipart/form-data']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['petstore_auth'] # noqa: E501
+
+ _response_types_map = {
+ '200': "ApiResponse",
+ }
+
+ return self.api_client.call_api(
+ '/pet/{petId}/uploadImage', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def upload_file_with_required_file(self, pet_id : Annotated[StrictInt, Field(..., description="ID of pet to update")], required_file : Annotated[StrictStr, Field(..., description="file to upload")], additional_metadata : Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None, **kwargs) -> ApiResponse: # noqa: E501
+ """uploads an image (required) # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.upload_file_with_required_file(pet_id, required_file, additional_metadata, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param required_file: file to upload (required)
+ :type required_file: str
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: ApiResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.upload_file_with_required_file_with_http_info(pet_id, required_file, additional_metadata, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def upload_file_with_required_file_with_http_info(self, pet_id : Annotated[StrictInt, Field(..., description="ID of pet to update")], required_file : Annotated[StrictStr, Field(..., description="file to upload")], additional_metadata : Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None, **kwargs): # noqa: E501
+ """uploads an image (required) # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, additional_metadata, async_req=True)
+ >>> result = thread.get()
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param required_file: file to upload (required)
+ :type required_file: str
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'pet_id',
+ 'required_file',
+ 'additional_metadata'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method upload_file_with_required_file" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['pet_id']:
+ _path_params['petId'] = _params['pet_id']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ if _params['additional_metadata']:
+ _form_params.append(('additionalMetadata', _params['additional_metadata']))
+ if _params['required_file']:
+ _files['requiredFile'] = _params['required_file']
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['multipart/form-data']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['petstore_auth'] # noqa: E501
+
+ _response_types_map = {
+ '200': "ApiResponse",
+ }
+
+ return self.api_client.call_api(
+ '/fake/{petId}/uploadImageWithRequiredFile', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/store_api.py
new file mode 100755
index 00000000000..03a16e515ff
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/store_api.py
@@ -0,0 +1,612 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictStr, conint
+
+from typing import Dict
+
+from petstore_api.models.order import Order
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class StoreApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def delete_order(self, order_id : Annotated[StrictStr, Field(..., description="ID of the order that needs to be deleted")], **kwargs) -> None: # noqa: E501
+ """Delete purchase order by ID # noqa: E501
+
+ For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_order(order_id, async_req=True)
+ >>> result = thread.get()
+
+ :param order_id: ID of the order that needs to be deleted (required)
+ :type order_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def delete_order_with_http_info(self, order_id : Annotated[StrictStr, Field(..., description="ID of the order that needs to be deleted")], **kwargs): # noqa: E501
+ """Delete purchase order by ID # noqa: E501
+
+ For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_order_with_http_info(order_id, async_req=True)
+ >>> result = thread.get()
+
+ :param order_id: ID of the order that needs to be deleted (required)
+ :type order_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'order_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method delete_order" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['order_id']:
+ _path_params['order_id'] = _params['order_id']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/store/order/{order_id}', 'DELETE',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def get_inventory(self, **kwargs) -> Dict[str, int]: # noqa: E501
+ """Returns pet inventories by status # noqa: E501
+
+ Returns a map of status codes to quantities # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_inventory(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Dict[str, int]
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_inventory_with_http_info(**kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_inventory_with_http_info(self, **kwargs): # noqa: E501
+ """Returns pet inventories by status # noqa: E501
+
+ Returns a map of status codes to quantities # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_inventory_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Dict[str, int], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_inventory" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['api_key'] # noqa: E501
+
+ _response_types_map = {
+ '200': "Dict[str, int]",
+ }
+
+ return self.api_client.call_api(
+ '/store/inventory', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def get_order_by_id(self, order_id : Annotated[conint(strict=True, ge=5, le=1), Field(..., description="ID of pet that needs to be fetched")], **kwargs) -> Order: # noqa: E501
+ """Find purchase order by ID # noqa: E501
+
+ For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_order_by_id(order_id, async_req=True)
+ >>> result = thread.get()
+
+ :param order_id: ID of pet that needs to be fetched (required)
+ :type order_id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Order
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_order_by_id_with_http_info(self, order_id : Annotated[conint(strict=True, ge=5, le=1), Field(..., description="ID of pet that needs to be fetched")], **kwargs): # noqa: E501
+ """Find purchase order by ID # noqa: E501
+
+ For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True)
+ >>> result = thread.get()
+
+ :param order_id: ID of pet that needs to be fetched (required)
+ :type order_id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'order_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_order_by_id" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['order_id']:
+ _path_params['order_id'] = _params['order_id']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "Order",
+ '400': None,
+ '404': None,
+ }
+
+ return self.api_client.call_api(
+ '/store/order/{order_id}', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def place_order(self, order : Annotated[Order, Field(..., description="order placed for purchasing the pet")], **kwargs) -> Order: # noqa: E501
+ """Place an order for a pet # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.place_order(order, async_req=True)
+ >>> result = thread.get()
+
+ :param order: order placed for purchasing the pet (required)
+ :type order: Order
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Order
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.place_order_with_http_info(order, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def place_order_with_http_info(self, order : Annotated[Order, Field(..., description="order placed for purchasing the pet")], **kwargs): # noqa: E501
+ """Place an order for a pet # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.place_order_with_http_info(order, async_req=True)
+ >>> result = thread.get()
+
+ :param order: order placed for purchasing the pet (required)
+ :type order: Order
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'order'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method place_order" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['order']:
+ _body_params = _params['order']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "Order",
+ '400': None,
+ }
+
+ return self.api_client.call_api(
+ '/store/order', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/user_api.py
new file mode 100755
index 00000000000..5eba7fa1eef
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/user_api.py
@@ -0,0 +1,1204 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import re # noqa: F401
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictStr
+
+from typing import List
+
+from petstore_api.models.user import User
+
+from petstore_api.api_client import ApiClient
+from petstore_api.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class UserApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def create_user(self, user : Annotated[User, Field(..., description="Created user object")], **kwargs) -> None: # noqa: E501
+ """Create user # noqa: E501
+
+ This can only be done by the logged in user. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_user(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: Created user object (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.create_user_with_http_info(user, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def create_user_with_http_info(self, user : Annotated[User, Field(..., description="Created user object")], **kwargs): # noqa: E501
+ """Create user # noqa: E501
+
+ This can only be done by the logged in user. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_user_with_http_info(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: Created user object (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _hosts = [
+ 'http://petstore.swagger.io/v2',
+ 'http://path-server-test.petstore.local/v2',
+ 'http://{server}.swagger.io:{port}/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'user'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method create_user" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['user']:
+ _body_params = _params['user']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def create_users_with_array_input(self, user : Annotated[List[User], Field(..., description="List of user object")], **kwargs) -> None: # noqa: E501
+ """Creates list of users with given input array # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_users_with_array_input(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: List of user object (required)
+ :type user: List[User]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.create_users_with_array_input_with_http_info(user, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def create_users_with_array_input_with_http_info(self, user : Annotated[List[User], Field(..., description="List of user object")], **kwargs): # noqa: E501
+ """Creates list of users with given input array # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_users_with_array_input_with_http_info(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: List of user object (required)
+ :type user: List[User]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'user'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method create_users_with_array_input" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['user']:
+ _body_params = _params['user']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/createWithArray', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def create_users_with_list_input(self, user : Annotated[List[User], Field(..., description="List of user object")], **kwargs) -> None: # noqa: E501
+ """Creates list of users with given input array # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_users_with_list_input(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: List of user object (required)
+ :type user: List[User]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.create_users_with_list_input_with_http_info(user, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def create_users_with_list_input_with_http_info(self, user : Annotated[List[User], Field(..., description="List of user object")], **kwargs): # noqa: E501
+ """Creates list of users with given input array # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_users_with_list_input_with_http_info(user, async_req=True)
+ >>> result = thread.get()
+
+ :param user: List of user object (required)
+ :type user: List[User]
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'user'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method create_users_with_list_input" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['user']:
+ _body_params = _params['user']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/createWithList', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def delete_user(self, username : Annotated[StrictStr, Field(..., description="The name that needs to be deleted")], **kwargs) -> None: # noqa: E501
+ """Delete user # noqa: E501
+
+ This can only be done by the logged in user. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_user(username, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The name that needs to be deleted (required)
+ :type username: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.delete_user_with_http_info(username, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def delete_user_with_http_info(self, username : Annotated[StrictStr, Field(..., description="The name that needs to be deleted")], **kwargs): # noqa: E501
+ """Delete user # noqa: E501
+
+ This can only be done by the logged in user. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_user_with_http_info(username, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The name that needs to be deleted (required)
+ :type username: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'username'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method delete_user" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['username']:
+ _path_params['username'] = _params['username']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/{username}', 'DELETE',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def get_user_by_name(self, username : Annotated[StrictStr, Field(..., description="The name that needs to be fetched. Use user1 for testing.")], **kwargs) -> User: # noqa: E501
+ """Get user by user name # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_user_by_name(username, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The name that needs to be fetched. Use user1 for testing. (required)
+ :type username: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: User
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_user_by_name_with_http_info(self, username : Annotated[StrictStr, Field(..., description="The name that needs to be fetched. Use user1 for testing.")], **kwargs): # noqa: E501
+ """Get user by user name # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_user_by_name_with_http_info(username, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The name that needs to be fetched. Use user1 for testing. (required)
+ :type username: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'username'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_user_by_name" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['username']:
+ _path_params['username'] = _params['username']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "User",
+ '400': None,
+ '404': None,
+ }
+
+ return self.api_client.call_api(
+ '/user/{username}', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def login_user(self, username : Annotated[StrictStr, Field(..., description="The user name for login")], password : Annotated[StrictStr, Field(..., description="The password for login in clear text")], **kwargs) -> str: # noqa: E501
+ """Logs user into the system # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.login_user(username, password, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The user name for login (required)
+ :type username: str
+ :param password: The password for login in clear text (required)
+ :type password: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: str
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def login_user_with_http_info(self, username : Annotated[StrictStr, Field(..., description="The user name for login")], password : Annotated[StrictStr, Field(..., description="The password for login in clear text")], **kwargs): # noqa: E501
+ """Logs user into the system # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.login_user_with_http_info(username, password, async_req=True)
+ >>> result = thread.get()
+
+ :param username: The user name for login (required)
+ :type username: str
+ :param password: The password for login in clear text (required)
+ :type password: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'username',
+ 'password'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method login_user" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('username') is not None: # noqa: E501
+ _query_params.append(('username', _params['username']))
+ if _params.get('password') is not None: # noqa: E501
+ _query_params.append(('password', _params['password']))
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/xml', 'application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {
+ '200': "str",
+ '400': None,
+ }
+
+ return self.api_client.call_api(
+ '/user/login', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def logout_user(self, **kwargs) -> None: # noqa: E501
+ """Logs out current logged in user session # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.logout_user(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.logout_user_with_http_info(**kwargs) # noqa: E501
+
+ @validate_arguments
+ def logout_user_with_http_info(self, **kwargs): # noqa: E501
+ """Logs out current logged in user session # noqa: E501
+
+ # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.logout_user_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method logout_user" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/logout', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def update_user(self, username : Annotated[StrictStr, Field(..., description="name that need to be deleted")], user : Annotated[User, Field(..., description="Updated user object")], **kwargs) -> None: # noqa: E501
+ """Updated user # noqa: E501
+
+ This can only be done by the logged in user. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_user(username, user, async_req=True)
+ >>> result = thread.get()
+
+ :param username: name that need to be deleted (required)
+ :type username: str
+ :param user: Updated user object (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ return self.update_user_with_http_info(username, user, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def update_user_with_http_info(self, username : Annotated[StrictStr, Field(..., description="name that need to be deleted")], user : Annotated[User, Field(..., description="Updated user object")], **kwargs): # noqa: E501
+ """Updated user # noqa: E501
+
+ This can only be done by the logged in user. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_user_with_http_info(username, user, async_req=True)
+ >>> result = thread.get()
+
+ :param username: name that need to be deleted (required)
+ :type username: str
+ :param user: Updated user object (required)
+ :type user: User
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :type _return_http_data_only: bool, optional
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :type _preload_content: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = [
+ 'username',
+ 'user'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_user" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['username']:
+ _path_params['username'] = _params['username']
+
+ # process the query parameters
+ _query_params = []
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+
+ # process the body parameter
+ _body_params = None
+ if _params['user']:
+ _body_params = _params['user']
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = [] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/user/{username}', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api_client.py
new file mode 100755
index 00000000000..964dc6684e4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api_client.py
@@ -0,0 +1,752 @@
+# coding: utf-8
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+from __future__ import absolute_import
+
+import atexit
+import datetime
+from dateutil.parser import parse
+import json
+import mimetypes
+from multiprocessing.pool import ThreadPool
+import os
+import re
+import tempfile
+
+from urllib.parse import quote
+
+from petstore_api.configuration import Configuration
+import petstore_api.models
+from petstore_api import rest
+from petstore_api.exceptions import ApiValueError, ApiException
+
+
+class ApiClient(object):
+ """Generic API client for OpenAPI client library builds.
+
+ OpenAPI generic API client. This client handles the client-
+ server communication, and is invariant across implementations. Specifics of
+ the methods and models for each application are generated from the OpenAPI
+ templates.
+
+ NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+ Do not edit the class manually.
+
+ :param configuration: .Configuration object for this client
+ :param header_name: a header to pass when making calls to the API.
+ :param header_value: a header value to pass when making calls to
+ the API.
+ :param cookie: a cookie to include in the header when making calls
+ to the API
+ :param pool_threads: The number of threads to use for async requests
+ to the API. More threads means more concurrent API requests.
+ """
+
+ PRIMITIVE_TYPES = (float, bool, bytes, str, int)
+ NATIVE_TYPES_MAPPING = {
+ 'int': int,
+ 'long': int, # TODO remove as only py3 is supported?
+ 'float': float,
+ 'str': str,
+ 'bool': bool,
+ 'date': datetime.date,
+ 'datetime': datetime.datetime,
+ 'object': object,
+ }
+ _pool = None
+
+ def __init__(self, configuration=None, header_name=None, header_value=None,
+ cookie=None, pool_threads=1):
+ # use default configuraiton if none is provided
+ if configuration is None:
+ configuration = Configuration.get_default()
+ self.configuration = configuration
+ self.pool_threads = pool_threads
+
+ self.rest_client = rest.RESTClientObject(configuration)
+ self.default_headers = {}
+ if header_name is not None:
+ self.default_headers[header_name] = header_value
+ self.cookie = cookie
+ # Set default User-Agent.
+ self.user_agent = 'OpenAPI-Generator/1.0.0/python'
+ self.client_side_validation = configuration.client_side_validation
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_value, traceback):
+ self.close()
+
+ def close(self):
+ if self._pool:
+ self._pool.close()
+ self._pool.join()
+ self._pool = None
+ if hasattr(atexit, 'unregister'):
+ atexit.unregister(self.close)
+
+ @property
+ def pool(self):
+ """Create thread pool on first request
+ avoids instantiating unused threadpool for blocking clients.
+ """
+ if self._pool is None:
+ atexit.register(self.close)
+ self._pool = ThreadPool(self.pool_threads)
+ return self._pool
+
+ @property
+ def user_agent(self):
+ """User agent for this API client"""
+ return self.default_headers['User-Agent']
+
+ @user_agent.setter
+ def user_agent(self, value):
+ self.default_headers['User-Agent'] = value
+
+ def set_default_header(self, header_name, header_value):
+ self.default_headers[header_name] = header_value
+
+
+ _default = None
+
+ @classmethod
+ def get_default(cls):
+ """Return new instance of ApiClient.
+
+ This method returns newly created, based on default constructor,
+ object of ApiClient class or returns a copy of default
+ ApiClient.
+
+ :return: The ApiClient object.
+ """
+ if cls._default is None:
+ cls._default = ApiClient()
+ return cls._default
+
+ @classmethod
+ def set_default(cls, default):
+ """Set default instance of ApiClient.
+
+ It stores default ApiClient.
+
+ :param default: object of ApiClient.
+ """
+ cls._default = default
+
+ def __call_api(
+ self, resource_path, method, path_params=None,
+ query_params=None, header_params=None, body=None, post_params=None,
+ files=None, response_types_map=None, auth_settings=None,
+ _return_http_data_only=None, collection_formats=None,
+ _preload_content=True, _request_timeout=None, _host=None,
+ _request_auth=None):
+
+ config = self.configuration
+
+ # header parameters
+ header_params = header_params or {}
+ header_params.update(self.default_headers)
+ if self.cookie:
+ header_params['Cookie'] = self.cookie
+ if header_params:
+ header_params = self.sanitize_for_serialization(header_params)
+ header_params = dict(self.parameters_to_tuples(header_params,
+ collection_formats))
+
+ # path parameters
+ if path_params:
+ path_params = self.sanitize_for_serialization(path_params)
+ path_params = self.parameters_to_tuples(path_params,
+ collection_formats)
+ for k, v in path_params:
+ # specified safe chars, encode everything
+ resource_path = resource_path.replace(
+ '{%s}' % k,
+ quote(str(v), safe=config.safe_chars_for_path_param)
+ )
+
+ # post parameters
+ if post_params or files:
+ post_params = post_params if post_params else []
+ post_params = self.sanitize_for_serialization(post_params)
+ post_params = self.parameters_to_tuples(post_params,
+ collection_formats)
+ post_params.extend(self.files_parameters(files))
+
+ # auth setting
+ self.update_params_for_auth(
+ header_params, query_params, auth_settings,
+ resource_path, method, body,
+ request_auth=_request_auth)
+
+ # body
+ if body:
+ body = self.sanitize_for_serialization(body)
+
+ # request url
+ if _host is None:
+ url = self.configuration.host + resource_path
+ else:
+ # use server/host defined in path or operation instead
+ url = _host + resource_path
+
+ # query parameters
+ if query_params:
+ query_params = self.sanitize_for_serialization(query_params)
+ url_query = self.parameters_to_url_query(query_params,
+ collection_formats)
+ url += "?" + url_query
+
+ try:
+ # perform request and return response
+ response_data = self.request(
+ method, url,
+ query_params=query_params,
+ headers=header_params,
+ post_params=post_params, body=body,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout)
+ except ApiException as e:
+ if e.body:
+ e.body = e.body.decode('utf-8')
+ raise e
+
+ self.last_response = response_data
+
+ return_data = response_data
+
+ if not _preload_content:
+ return return_data
+
+ response_type = response_types_map.get(str(response_data.status), None)
+
+ if response_type not in ["file", "bytes"]:
+ match = None
+ content_type = response_data.getheader('content-type')
+ if content_type is not None:
+ match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
+ encoding = match.group(1) if match else "utf-8"
+ response_data.data = response_data.data.decode(encoding)
+
+ # deserialize response data
+
+ if response_type:
+ return_data = self.deserialize(response_data, response_type)
+ else:
+ return_data = None
+
+ if _return_http_data_only:
+ return (return_data)
+ else:
+ return (return_data, response_data.status,
+ response_data.getheaders())
+
+ def sanitize_for_serialization(self, obj):
+ """Builds a JSON POST object.
+
+ If obj is None, return None.
+ If obj is str, int, long, float, bool, return directly.
+ If obj is datetime.datetime, datetime.date
+ convert to string in iso8601 format.
+ If obj is list, sanitize each element in the list.
+ If obj is dict, return the dict.
+ If obj is OpenAPI model, return the properties dict.
+
+ :param obj: The data to serialize.
+ :return: The serialized form of data.
+ """
+ if obj is None:
+ return None
+ elif isinstance(obj, self.PRIMITIVE_TYPES):
+ return obj
+ elif isinstance(obj, list):
+ return [self.sanitize_for_serialization(sub_obj)
+ for sub_obj in obj]
+ elif isinstance(obj, tuple):
+ return tuple(self.sanitize_for_serialization(sub_obj)
+ for sub_obj in obj)
+ elif isinstance(obj, (datetime.datetime, datetime.date)):
+ return obj.isoformat()
+
+ if isinstance(obj, dict):
+ obj_dict = obj
+ else:
+ # Convert model obj to dict except
+ # attributes `openapi_types`, `attribute_map`
+ # and attributes which value is not None.
+ # Convert attribute name to json key in
+ # model definition for request.
+ obj_dict = obj.to_dict()
+
+ return {key: self.sanitize_for_serialization(val)
+ for key, val in obj_dict.items()}
+
+ def deserialize(self, response, response_type):
+ """Deserializes response into an object.
+
+ :param response: RESTResponse object to be deserialized.
+ :param response_type: class literal for
+ deserialized object, or string of class name.
+
+ :return: deserialized object.
+ """
+ # handle file downloading
+ # save response body into a tmp file and return the instance
+ if response_type == "file":
+ return self.__deserialize_file(response)
+
+ # fetch data from response object
+ try:
+ data = json.loads(response.data)
+ except ValueError:
+ data = response.data
+
+ return self.__deserialize(data, response_type)
+
+ def __deserialize(self, data, klass):
+ """Deserializes dict, list, str into an object.
+
+ :param data: dict, list or str.
+ :param klass: class literal, or string of class name.
+
+ :return: object.
+ """
+ if data is None:
+ return None
+
+ if type(klass) == str:
+ if klass.startswith('List['):
+ sub_kls = re.match(r'List\[(.*)]', klass).group(1)
+ return [self.__deserialize(sub_data, sub_kls)
+ for sub_data in data]
+
+ if klass.startswith('Dict['):
+ sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2)
+ return {k: self.__deserialize(v, sub_kls)
+ for k, v in data.items()}
+
+ # convert str to class
+ if klass in self.NATIVE_TYPES_MAPPING:
+ klass = self.NATIVE_TYPES_MAPPING[klass]
+ else:
+ klass = getattr(petstore_api.models, klass)
+
+ if klass in self.PRIMITIVE_TYPES:
+ return self.__deserialize_primitive(data, klass)
+ elif klass == object:
+ return self.__deserialize_object(data)
+ elif klass == datetime.date:
+ return self.__deserialize_date(data)
+ elif klass == datetime.datetime:
+ return self.__deserialize_datetime(data)
+ else:
+ return self.__deserialize_model(data, klass)
+
+ def call_api(self, resource_path, method,
+ path_params=None, query_params=None, header_params=None,
+ body=None, post_params=None, files=None,
+ response_types_map=None, auth_settings=None,
+ async_req=None, _return_http_data_only=None,
+ collection_formats=None,_preload_content=True,
+ _request_timeout=None, _host=None, _request_auth=None):
+ """Makes the HTTP request (synchronous) and returns deserialized data.
+
+ To make an async_req request, set the async_req parameter.
+
+ :param resource_path: Path to method endpoint.
+ :param method: Method to call.
+ :param path_params: Path parameters in the url.
+ :param query_params: Query parameters in the url.
+ :param header_params: Header parameters to be
+ placed in the request header.
+ :param body: Request body.
+ :param post_params dict: Request post form parameters,
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
+ :param auth_settings list: Auth Settings names for the request.
+ :param response: Response data type.
+ :param files dict: key -> filename, value -> filepath,
+ for `multipart/form-data`.
+ :param async_req bool: execute request asynchronously
+ :param _return_http_data_only: response data without head status code
+ and headers
+ :param collection_formats: dict of collection formats for path, query,
+ header, and post parameters.
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_token: dict, optional
+ :return:
+ If async_req parameter is True,
+ the request will be called asynchronously.
+ The method will return the request thread.
+ If parameter async_req is False or missing,
+ then the method will return the response directly.
+ """
+ if not async_req:
+ return self.__call_api(resource_path, method,
+ path_params, query_params, header_params,
+ body, post_params, files,
+ response_types_map, auth_settings,
+ _return_http_data_only, collection_formats,
+ _preload_content, _request_timeout, _host,
+ _request_auth)
+
+ return self.pool.apply_async(self.__call_api, (resource_path,
+ method, path_params,
+ query_params,
+ header_params, body,
+ post_params, files,
+ response_types_map,
+ auth_settings,
+ _return_http_data_only,
+ collection_formats,
+ _preload_content,
+ _request_timeout,
+ _host, _request_auth))
+
+ def request(self, method, url, query_params=None, headers=None,
+ post_params=None, body=None, _preload_content=True,
+ _request_timeout=None):
+ """Makes the HTTP request using RESTClient."""
+ if method == "GET":
+ return self.rest_client.get_request(url,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ headers=headers)
+ elif method == "HEAD":
+ return self.rest_client.head_request(url,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ headers=headers)
+ elif method == "OPTIONS":
+ return self.rest_client.options_request(url,
+ query_params=query_params,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout)
+ elif method == "POST":
+ return self.rest_client.post_request(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "PUT":
+ return self.rest_client.put_request(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "PATCH":
+ return self.rest_client.patch_request(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "DELETE":
+ return self.rest_client.delete_request(url,
+ query_params=query_params,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ else:
+ raise ApiValueError(
+ "http method must be `GET`, `HEAD`, `OPTIONS`,"
+ " `POST`, `PATCH`, `PUT` or `DELETE`."
+ )
+
+ def parameters_to_tuples(self, params, collection_formats):
+ """Get parameters as list of tuples, formatting collections.
+
+ :param params: Parameters as dict or list of two-tuples
+ :param dict collection_formats: Parameter collection formats
+ :return: Parameters as list of tuples, collections formatted
+ """
+ new_params = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == 'multi':
+ new_params.extend((k, value) for value in v)
+ else:
+ if collection_format == 'ssv':
+ delimiter = ' '
+ elif collection_format == 'tsv':
+ delimiter = '\t'
+ elif collection_format == 'pipes':
+ delimiter = '|'
+ else: # csv is the default
+ delimiter = ','
+ new_params.append(
+ (k, delimiter.join(str(value) for value in v)))
+ else:
+ new_params.append((k, v))
+ return new_params
+
+ def parameters_to_url_query(self, params, collection_formats):
+ """Get parameters as list of tuples, formatting collections.
+
+ :param params: Parameters as dict or list of two-tuples
+ :param dict collection_formats: Parameter collection formats
+ :return: URL query string (e.g. a=Hello%20World&b=123)
+ """
+ new_params = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == 'multi':
+ new_params.extend((k, value) for value in v)
+ else:
+ if collection_format == 'ssv':
+ delimiter = ' '
+ elif collection_format == 'tsv':
+ delimiter = '\t'
+ elif collection_format == 'pipes':
+ delimiter = '|'
+ else: # csv is the default
+ delimiter = ','
+ new_params.append(
+ (k, delimiter.join(quote(str(value)) for value in v)))
+ else:
+ new_params.append((k, v))
+
+ return "&".join(["=".join(item) for item in new_params])
+
+ def files_parameters(self, files=None):
+ """Builds form parameters.
+
+ :param files: File parameters.
+ :return: Form parameters with files.
+ """
+ params = []
+
+ if files:
+ for k, v in files.items():
+ if not v:
+ continue
+ file_names = v if type(v) is list else [v]
+ for n in file_names:
+ with open(n, 'rb') as f:
+ filename = os.path.basename(f.name)
+ filedata = f.read()
+ mimetype = (mimetypes.guess_type(filename)[0] or
+ 'application/octet-stream')
+ params.append(
+ tuple([k, tuple([filename, filedata, mimetype])]))
+
+ return params
+
+ def select_header_accept(self, accepts):
+ """Returns `Accept` based on an array of accepts provided.
+
+ :param accepts: List of headers.
+ :return: Accept (e.g. application/json).
+ """
+ if not accepts:
+ return
+
+ for accept in accepts:
+ if re.search('json', accept, re.IGNORECASE):
+ return accept
+
+ return accepts[0]
+
+ def select_header_content_type(self, content_types):
+ """Returns `Content-Type` based on an array of content_types provided.
+
+ :param content_types: List of content-types.
+ :return: Content-Type (e.g. application/json).
+ """
+ if not content_types:
+ return None
+
+ for content_type in content_types:
+ if re.search('json', content_type, re.IGNORECASE):
+ return content_type
+
+ return content_types[0]
+
+ def update_params_for_auth(self, headers, queries, auth_settings,
+ resource_path, method, body,
+ request_auth=None):
+ """Updates header and query params based on authentication setting.
+
+ :param headers: Header parameters dict to be updated.
+ :param queries: Query parameters tuple list to be updated.
+ :param auth_settings: Authentication setting identifiers list.
+ :resource_path: A string representation of the HTTP request resource path.
+ :method: A string representation of the HTTP request method.
+ :body: A object representing the body of the HTTP request.
+ The object type is the return value of sanitize_for_serialization().
+ :param request_auth: if set, the provided settings will
+ override the token in the configuration.
+ """
+ if not auth_settings:
+ return
+
+ if request_auth:
+ self._apply_auth_params(headers, queries,
+ resource_path, method, body,
+ request_auth)
+ return
+
+ for auth in auth_settings:
+ auth_setting = self.configuration.auth_settings().get(auth)
+ if auth_setting:
+ self._apply_auth_params(headers, queries,
+ resource_path, method, body,
+ auth_setting)
+
+ def _apply_auth_params(self, headers, queries,
+ resource_path, method, body,
+ auth_setting):
+ """Updates the request parameters based on a single auth_setting
+
+ :param headers: Header parameters dict to be updated.
+ :param queries: Query parameters tuple list to be updated.
+ :resource_path: A string representation of the HTTP request resource path.
+ :method: A string representation of the HTTP request method.
+ :body: A object representing the body of the HTTP request.
+ The object type is the return value of sanitize_for_serialization().
+ :param auth_setting: auth settings for the endpoint
+ """
+ if auth_setting['in'] == 'cookie':
+ headers['Cookie'] = auth_setting['value']
+ elif auth_setting['in'] == 'header':
+ if auth_setting['type'] != 'http-signature':
+ headers[auth_setting['key']] = auth_setting['value']
+ else:
+ # The HTTP signature scheme requires multiple HTTP headers
+ # that are calculated dynamically.
+ signing_info = self.configuration.signing_info
+ auth_headers = signing_info.get_http_signature_headers(
+ resource_path, method, headers, body, queries)
+ headers.update(auth_headers)
+ elif auth_setting['in'] == 'query':
+ queries.append((auth_setting['key'], auth_setting['value']))
+ else:
+ raise ApiValueError(
+ 'Authentication token must be in `query` or `header`'
+ )
+
+ def __deserialize_file(self, response):
+ """Deserializes body to file
+
+ Saves response body into a file in a temporary folder,
+ using the filename from the `Content-Disposition` header if provided.
+
+ :param response: RESTResponse.
+ :return: file path.
+ """
+ fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
+ os.close(fd)
+ os.remove(path)
+
+ content_disposition = response.getheader("Content-Disposition")
+ if content_disposition:
+ filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
+ content_disposition).group(1)
+ path = os.path.join(os.path.dirname(path), filename)
+
+ with open(path, "wb") as f:
+ f.write(response.data)
+
+ return path
+
+ def __deserialize_primitive(self, data, klass):
+ """Deserializes string to primitive type.
+
+ :param data: str.
+ :param klass: class literal.
+
+ :return: int, long, float, str, bool.
+ """
+ try:
+ return klass(data)
+ except UnicodeEncodeError:
+ return str(data)
+ except TypeError:
+ return data
+
+ def __deserialize_object(self, value):
+ """Return an original value.
+
+ :return: object.
+ """
+ return value
+
+ def __deserialize_date(self, string):
+ """Deserializes string to date.
+
+ :param string: str.
+ :return: date.
+ """
+ try:
+ return parse(string).date()
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason="Failed to parse `{0}` as date object".format(string)
+ )
+
+ def __deserialize_datetime(self, string):
+ """Deserializes string to datetime.
+
+ The string should be in iso8601 datetime format.
+
+ :param string: str.
+ :return: datetime.
+ """
+ try:
+ return parse(string)
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason=(
+ "Failed to parse `{0}` as datetime object"
+ .format(string)
+ )
+ )
+
+ def __deserialize_model(self, data, klass):
+ """Deserializes list or dict to model.
+
+ :param data: dict, list.
+ :param klass: class literal.
+ :return: model object.
+ """
+
+ return klass.from_dict(data)
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/configuration.py
new file mode 100755
index 00000000000..acae925a0cb
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/configuration.py
@@ -0,0 +1,630 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import copy
+import logging
+import multiprocessing
+import sys
+import urllib3
+
+import http.client as httplib
+from petstore_api.exceptions import ApiValueError
+
+
+JSON_SCHEMA_VALIDATION_KEYWORDS = {
+ 'multipleOf', 'maximum', 'exclusiveMaximum',
+ 'minimum', 'exclusiveMinimum', 'maxLength',
+ 'minLength', 'pattern', 'maxItems', 'minItems'
+}
+
+class Configuration(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+
+ Ref: https://openapi-generator.tech
+ Do not edit the class manually.
+
+ :param host: Base url.
+ :param api_key: Dict to store API key(s).
+ Each entry in the dict specifies an API key.
+ The dict key is the name of the security scheme in the OAS specification.
+ The dict value is the API key secret.
+ :param api_key_prefix: Dict to store API prefix (e.g. Bearer).
+ The dict key is the name of the security scheme in the OAS specification.
+ The dict value is an API key prefix when generating the auth data.
+ :param username: Username for HTTP basic authentication.
+ :param password: Password for HTTP basic authentication.
+ :param discard_unknown_keys: Boolean value indicating whether to discard
+ unknown properties. A server may send a response that includes additional
+ properties that are not known by the client in the following scenarios:
+ 1. The OpenAPI document is incomplete, i.e. it does not match the server
+ implementation.
+ 2. The client was generated using an older version of the OpenAPI document
+ and the server has been upgraded since then.
+ If a schema in the OpenAPI document defines the additionalProperties attribute,
+ then all undeclared properties received by the server are injected into the
+ additional properties map. In that case, there are undeclared properties, and
+ nothing to discard.
+ :param disabled_client_side_validations (string): Comma-separated list of
+ JSON schema validation keywords to disable JSON schema structural validation
+ rules. The following keywords may be specified: multipleOf, maximum,
+ exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern,
+ maxItems, minItems.
+ By default, the validation is performed for data generated locally by the client
+ and data received from the server, independent of any validation performed by
+ the server side. If the input data does not satisfy the JSON schema validation
+ rules specified in the OpenAPI document, an exception is raised.
+ If disabled_client_side_validations is set, structural validation is
+ disabled. This can be useful to troubleshoot data validation problem, such as
+ when the OpenAPI document validation rules do not match the actual API data
+ received by the server.
+ :param signing_info: Configuration parameters for the HTTP signature security scheme.
+ Must be an instance of petstore_api.signing.HttpSigningConfiguration
+ :param server_index: Index to servers configuration.
+ :param server_variables: Mapping with string values to replace variables in
+ templated server configuration. The validation of enums is performed for
+ variables with defined enum values before.
+ :param server_operation_index: Mapping from operation ID to an index to server
+ configuration.
+ :param server_operation_variables: Mapping from operation ID to a mapping with
+ string values to replace variables in templated server configuration.
+ The validation of enums is performed for variables with defined enum values before.
+ :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
+ in PEM format.
+
+ :Example:
+
+ API Key Authentication Example.
+ Given the following security scheme in the OpenAPI specification:
+ components:
+ securitySchemes:
+ cookieAuth: # name for the security scheme
+ type: apiKey
+ in: cookie
+ name: JSESSIONID # cookie name
+
+ You can programmatically set the cookie:
+
+conf = petstore_api.Configuration(
+ api_key={'cookieAuth': 'abc123'}
+ api_key_prefix={'cookieAuth': 'JSESSIONID'}
+)
+
+ The following cookie will be added to the HTTP request:
+ Cookie: JSESSIONID abc123
+
+ HTTP Basic Authentication Example.
+ Given the following security scheme in the OpenAPI specification:
+ components:
+ securitySchemes:
+ http_basic_auth:
+ type: http
+ scheme: basic
+
+ Configure API client with HTTP basic authentication:
+
+conf = petstore_api.Configuration(
+ username='the-user',
+ password='the-password',
+)
+
+
+ HTTP Signature Authentication Example.
+ Given the following security scheme in the OpenAPI specification:
+ components:
+ securitySchemes:
+ http_basic_auth:
+ type: http
+ scheme: signature
+
+ Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme,
+ sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time
+ of the signature to 5 minutes after the signature has been created.
+ Note you can use the constants defined in the petstore_api.signing module, and you can
+ also specify arbitrary HTTP headers to be included in the HTTP signature, except for the
+ 'Authorization' header, which is used to carry the signature.
+
+ One may be tempted to sign all headers by default, but in practice it rarely works.
+ This is because explicit proxies, transparent proxies, TLS termination endpoints or
+ load balancers may add/modify/remove headers. Include the HTTP headers that you know
+ are not going to be modified in transit.
+
+conf = petstore_api.Configuration(
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'rsa.pem',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_RSASSA_PSS,
+ signed_headers = [petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+ """
+
+ _default = None
+
+ def __init__(self, host=None,
+ api_key=None, api_key_prefix=None,
+ username=None, password=None,
+ discard_unknown_keys=False,
+ disabled_client_side_validations="",
+ signing_info=None,
+ server_index=None, server_variables=None,
+ server_operation_index=None, server_operation_variables=None,
+ ssl_ca_cert=None,
+ ):
+ """Constructor
+ """
+ self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host
+ """Default Base url
+ """
+ self.server_index = 0 if server_index is None and host is None else server_index
+ self.server_operation_index = server_operation_index or {}
+ """Default server index
+ """
+ self.server_variables = server_variables or {}
+ self.server_operation_variables = server_operation_variables or {}
+ """Default server variables
+ """
+ self.temp_folder_path = None
+ """Temp file folder for downloading files
+ """
+ # Authentication Settings
+ self.api_key = {}
+ if api_key:
+ self.api_key = api_key
+ """dict to store API key(s)
+ """
+ self.api_key_prefix = {}
+ if api_key_prefix:
+ self.api_key_prefix = api_key_prefix
+ """dict to store API prefix (e.g. Bearer)
+ """
+ self.refresh_api_key_hook = None
+ """function hook to refresh API key if expired
+ """
+ self.username = username
+ """Username for HTTP basic authentication
+ """
+ self.password = password
+ """Password for HTTP basic authentication
+ """
+ self.discard_unknown_keys = discard_unknown_keys
+ self.disabled_client_side_validations = disabled_client_side_validations
+ if signing_info is not None:
+ signing_info.host = host
+ self.signing_info = signing_info
+ """The HTTP signing configuration
+ """
+ self.access_token = None
+ """access token for OAuth/Bearer
+ """
+ self.logger = {}
+ """Logging Settings
+ """
+ self.logger["package_logger"] = logging.getLogger("petstore_api")
+ self.logger["urllib3_logger"] = logging.getLogger("urllib3")
+ self.logger_format = '%(asctime)s %(levelname)s %(message)s'
+ """Log format
+ """
+ self.logger_stream_handler = None
+ """Log stream handler
+ """
+ self.logger_file_handler = None
+ """Log file handler
+ """
+ self.logger_file = None
+ """Debug file location
+ """
+ self.debug = False
+ """Debug switch
+ """
+
+ self.verify_ssl = True
+ """SSL/TLS verification
+ Set this to false to skip verifying SSL certificate when calling API
+ from https server.
+ """
+ self.ssl_ca_cert = ssl_ca_cert
+ """Set this to customize the certificate file to verify the peer.
+ """
+ self.cert_file = None
+ """client certificate file
+ """
+ self.key_file = None
+ """client key file
+ """
+ self.assert_hostname = None
+ """Set this to True/False to enable/disable SSL hostname verification.
+ """
+
+ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
+ """urllib3 connection pool's maximum number of connections saved
+ per pool. urllib3 uses 1 connection as default value, but this is
+ not the best value when you are making a lot of possibly parallel
+ requests to the same host, which is often the case here.
+ cpu_count * 5 is used as default value to increase performance.
+ """
+
+ self.proxy = None
+ """Proxy URL
+ """
+ self.proxy_headers = None
+ """Proxy headers
+ """
+ self.safe_chars_for_path_param = ''
+ """Safe chars for path_param
+ """
+ self.retries = None
+ """Adding retries to override urllib3 default value 3
+ """
+ # Enable client side validation
+ self.client_side_validation = True
+
+ self.socket_options = None
+ """Options to pass down to the underlying urllib3 socket
+ """
+
+ def __deepcopy__(self, memo):
+ cls = self.__class__
+ result = cls.__new__(cls)
+ memo[id(self)] = result
+ for k, v in self.__dict__.items():
+ if k not in ('logger', 'logger_file_handler'):
+ setattr(result, k, copy.deepcopy(v, memo))
+ # shallow copy of loggers
+ result.logger = copy.copy(self.logger)
+ # use setters to configure loggers
+ result.logger_file = self.logger_file
+ result.debug = self.debug
+ return result
+
+ def __setattr__(self, name, value):
+ object.__setattr__(self, name, value)
+ if name == 'disabled_client_side_validations':
+ s = set(filter(None, value.split(',')))
+ for v in s:
+ if v not in JSON_SCHEMA_VALIDATION_KEYWORDS:
+ raise ApiValueError(
+ "Invalid keyword: '{0}''".format(v))
+ self._disabled_client_side_validations = s
+ if name == "signing_info" and value is not None:
+ # Ensure the host parameter from signing info is the same as
+ # Configuration.host.
+ value.host = self.host
+
+ @classmethod
+ def set_default(cls, default):
+ """Set default instance of configuration.
+
+ It stores default configuration, which can be
+ returned by get_default_copy method.
+
+ :param default: object of Configuration
+ """
+ cls._default = default
+
+ @classmethod
+ def get_default_copy(cls):
+ """Deprecated. Please use `get_default` instead.
+
+ Deprecated. Please use `get_default` instead.
+
+ :return: The configuration object.
+ """
+ return cls.get_default()
+
+ @classmethod
+ def get_default(cls):
+ """Return the default configuration.
+
+ This method returns newly created, based on default constructor,
+ object of Configuration class or returns a copy of default
+ configuration.
+
+ :return: The configuration object.
+ """
+ if cls._default is None:
+ cls._default = Configuration()
+ return cls._default
+
+ @property
+ def logger_file(self):
+ """The logger file.
+
+ If the logger_file is None, then add stream handler and remove file
+ handler. Otherwise, add file handler and remove stream handler.
+
+ :param value: The logger_file path.
+ :type: str
+ """
+ return self.__logger_file
+
+ @logger_file.setter
+ def logger_file(self, value):
+ """The logger file.
+
+ If the logger_file is None, then add stream handler and remove file
+ handler. Otherwise, add file handler and remove stream handler.
+
+ :param value: The logger_file path.
+ :type: str
+ """
+ self.__logger_file = value
+ if self.__logger_file:
+ # If set logging file,
+ # then add file handler and remove stream handler.
+ self.logger_file_handler = logging.FileHandler(self.__logger_file)
+ self.logger_file_handler.setFormatter(self.logger_formatter)
+ for _, logger in self.logger.items():
+ logger.addHandler(self.logger_file_handler)
+
+ @property
+ def debug(self):
+ """Debug status
+
+ :param value: The debug status, True or False.
+ :type: bool
+ """
+ return self.__debug
+
+ @debug.setter
+ def debug(self, value):
+ """Debug status
+
+ :param value: The debug status, True or False.
+ :type: bool
+ """
+ self.__debug = value
+ if self.__debug:
+ # if debug status is True, turn on debug logging
+ for _, logger in self.logger.items():
+ logger.setLevel(logging.DEBUG)
+ # turn on httplib debug
+ httplib.HTTPConnection.debuglevel = 1
+ else:
+ # if debug status is False, turn off debug logging,
+ # setting log level to default `logging.WARNING`
+ for _, logger in self.logger.items():
+ logger.setLevel(logging.WARNING)
+ # turn off httplib debug
+ httplib.HTTPConnection.debuglevel = 0
+
+ @property
+ def logger_format(self):
+ """The logger format.
+
+ The logger_formatter will be updated when sets logger_format.
+
+ :param value: The format string.
+ :type: str
+ """
+ return self.__logger_format
+
+ @logger_format.setter
+ def logger_format(self, value):
+ """The logger format.
+
+ The logger_formatter will be updated when sets logger_format.
+
+ :param value: The format string.
+ :type: str
+ """
+ self.__logger_format = value
+ self.logger_formatter = logging.Formatter(self.__logger_format)
+
+ def get_api_key_with_prefix(self, identifier, alias=None):
+ """Gets API key (with prefix if set).
+
+ :param identifier: The identifier of apiKey.
+ :param alias: The alternative identifier of apiKey.
+ :return: The token for api key authentication.
+ """
+ if self.refresh_api_key_hook is not None:
+ self.refresh_api_key_hook(self)
+ key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
+ if key:
+ prefix = self.api_key_prefix.get(identifier)
+ if prefix:
+ return "%s %s" % (prefix, key)
+ else:
+ return key
+
+ def get_basic_auth_token(self):
+ """Gets HTTP basic authentication header (string).
+
+ :return: The token for basic HTTP authentication.
+ """
+ username = ""
+ if self.username is not None:
+ username = self.username
+ password = ""
+ if self.password is not None:
+ password = self.password
+ return urllib3.util.make_headers(
+ basic_auth=username + ':' + password
+ ).get('authorization')
+
+ def auth_settings(self):
+ """Gets Auth Settings dict for api client.
+
+ :return: The Auth Settings information dict.
+ """
+ auth = {}
+ if 'api_key' in self.api_key:
+ auth['api_key'] = {
+ 'type': 'api_key',
+ 'in': 'header',
+ 'key': 'api_key',
+ 'value': self.get_api_key_with_prefix(
+ 'api_key',
+ ),
+ }
+ if 'api_key_query' in self.api_key:
+ auth['api_key_query'] = {
+ 'type': 'api_key',
+ 'in': 'query',
+ 'key': 'api_key_query',
+ 'value': self.get_api_key_with_prefix(
+ 'api_key_query',
+ ),
+ }
+ if self.access_token is not None:
+ auth['bearer_test'] = {
+ 'type': 'bearer',
+ 'in': 'header',
+ 'format': 'JWT',
+ 'key': 'Authorization',
+ 'value': 'Bearer ' + self.access_token
+ }
+ if self.username is not None and self.password is not None:
+ auth['http_basic_test'] = {
+ 'type': 'basic',
+ 'in': 'header',
+ 'key': 'Authorization',
+ 'value': self.get_basic_auth_token()
+ }
+ if self.signing_info is not None:
+ auth['http_signature_test'] = {
+ 'type': 'http-signature',
+ 'in': 'header',
+ 'key': 'Authorization',
+ 'value': None # Signature headers are calculated for every HTTP request
+ }
+ if self.access_token is not None:
+ auth['petstore_auth'] = {
+ 'type': 'oauth2',
+ 'in': 'header',
+ 'key': 'Authorization',
+ 'value': 'Bearer ' + self.access_token
+ }
+ return auth
+
+ def to_debug_report(self):
+ """Gets the essential information for debugging.
+
+ :return: The report for debugging.
+ """
+ return "Python SDK Debug Report:\n"\
+ "OS: {env}\n"\
+ "Python Version: {pyversion}\n"\
+ "Version of the API: 1.0.0\n"\
+ "SDK Package Version: 1.0.0".\
+ format(env=sys.platform, pyversion=sys.version)
+
+ def get_host_settings(self):
+ """Gets an array of host settings
+
+ :return: An array of host settings
+ """
+ return [
+ {
+ 'url': "http://{server}.swagger.io:{port}/v2",
+ 'description': "petstore server",
+ 'variables': {
+ 'server': {
+ 'description': "No description provided",
+ 'default_value': "petstore",
+ 'enum_values': [
+ "petstore",
+ "qa-petstore",
+ "dev-petstore"
+ ]
+ },
+ 'port': {
+ 'description': "No description provided",
+ 'default_value': "80",
+ 'enum_values': [
+ "80",
+ "8080"
+ ]
+ }
+ }
+ },
+ {
+ 'url': "https://localhost:8080/{version}",
+ 'description': "The local server",
+ 'variables': {
+ 'version': {
+ 'description': "No description provided",
+ 'default_value': "v2",
+ 'enum_values': [
+ "v1",
+ "v2"
+ ]
+ }
+ }
+ },
+ {
+ 'url': "https://127.0.0.1/no_varaible",
+ 'description': "The local server without variables",
+ }
+ ]
+
+ def get_host_from_settings(self, index, variables=None, servers=None):
+ """Gets host URL based on the index and variables
+ :param index: array index of the host settings
+ :param variables: hash of variable and the corresponding value
+ :param servers: an array of host settings or None
+ :return: URL based on host settings
+ """
+ if index is None:
+ return self._base_path
+
+ variables = {} if variables is None else variables
+ servers = self.get_host_settings() if servers is None else servers
+
+ try:
+ server = servers[index]
+ except IndexError:
+ raise ValueError(
+ "Invalid index {0} when selecting the host settings. "
+ "Must be less than {1}".format(index, len(servers)))
+
+ url = server['url']
+
+ # go through variables and replace placeholders
+ for variable_name, variable in server.get('variables', {}).items():
+ used_value = variables.get(
+ variable_name, variable['default_value'])
+
+ if 'enum_values' in variable \
+ and used_value not in variable['enum_values']:
+ raise ValueError(
+ "The variable `{0}` in the host URL has invalid value "
+ "{1}. Must be {2}.".format(
+ variable_name, variables[variable_name],
+ variable['enum_values']))
+
+ url = url.replace("{" + variable_name + "}", used_value)
+
+ return url
+
+ @property
+ def host(self):
+ """Return generated host."""
+ return self.get_host_from_settings(self.server_index, variables=self.server_variables)
+
+ @host.setter
+ def host(self, value):
+ """Fix base path."""
+ self._base_path = value
+ self.server_index = None
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/exceptions.py
new file mode 100755
index 00000000000..b81fd7505ff
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/exceptions.py
@@ -0,0 +1,160 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+class OpenApiException(Exception):
+ """The base exception class for all OpenAPIExceptions"""
+
+
+class ApiTypeError(OpenApiException, TypeError):
+ def __init__(self, msg, path_to_item=None, valid_classes=None,
+ key_type=None):
+ """ Raises an exception for TypeErrors
+
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (list): a list of keys an indices to get to the
+ current_item
+ None if unset
+ valid_classes (tuple): the primitive classes that current item
+ should be an instance of
+ None if unset
+ key_type (bool): False if our value is a value in a dict
+ True if it is a key in a dict
+ False if our item is an item in a list
+ None if unset
+ """
+ self.path_to_item = path_to_item
+ self.valid_classes = valid_classes
+ self.key_type = key_type
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiTypeError, self).__init__(full_msg)
+
+
+class ApiValueError(OpenApiException, ValueError):
+ def __init__(self, msg, path_to_item=None):
+ """
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (list) the path to the exception in the
+ received_data dict. None if unset
+ """
+
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiValueError, self).__init__(full_msg)
+
+
+class ApiAttributeError(OpenApiException, AttributeError):
+ def __init__(self, msg, path_to_item=None):
+ """
+ Raised when an attribute reference or assignment fails.
+
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (None/list) the path to the exception in the
+ received_data dict
+ """
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiAttributeError, self).__init__(full_msg)
+
+
+class ApiKeyError(OpenApiException, KeyError):
+ def __init__(self, msg, path_to_item=None):
+ """
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (None/list) the path to the exception in the
+ received_data dict
+ """
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiKeyError, self).__init__(full_msg)
+
+
+class ApiException(OpenApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ if http_resp:
+ self.status = http_resp.status
+ self.reason = http_resp.reason
+ self.body = http_resp.data
+ self.headers = http_resp.getheaders()
+ else:
+ self.status = status
+ self.reason = reason
+ self.body = None
+ self.headers = None
+
+ def __str__(self):
+ """Custom error messages for exception"""
+ error_message = "({0})\n"\
+ "Reason: {1}\n".format(self.status, self.reason)
+ if self.headers:
+ error_message += "HTTP response headers: {0}\n".format(
+ self.headers)
+
+ if self.body:
+ error_message += "HTTP response body: {0}\n".format(self.body)
+
+ return error_message
+
+
+class NotFoundException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(NotFoundException, self).__init__(status, reason, http_resp)
+
+
+class UnauthorizedException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(UnauthorizedException, self).__init__(status, reason, http_resp)
+
+
+class ForbiddenException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(ForbiddenException, self).__init__(status, reason, http_resp)
+
+
+class ServiceException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(ServiceException, self).__init__(status, reason, http_resp)
+
+
+def render_path(path_to_item):
+ """Returns a string representation of a path"""
+ result = ""
+ for pth in path_to_item:
+ if isinstance(pth, int):
+ result += "[{0}]".format(pth)
+ else:
+ result += "['{0}']".format(pth)
+ return result
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/__init__.py
new file mode 100644
index 00000000000..b2660c977b9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/__init__.py
@@ -0,0 +1,72 @@
+# coding: utf-8
+
+# flake8: noqa
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+# import models into model package
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
+from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
+from petstore_api.models.animal import Animal
+from petstore_api.models.any_of_pig import AnyOfPig
+from petstore_api.models.api_response import ApiResponse
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
+from petstore_api.models.array_test import ArrayTest
+from petstore_api.models.basque_pig import BasquePig
+from petstore_api.models.capitalization import Capitalization
+from petstore_api.models.cat import Cat
+from petstore_api.models.cat_all_of import CatAllOf
+from petstore_api.models.category import Category
+from petstore_api.models.class_model import ClassModel
+from petstore_api.models.client import Client
+from petstore_api.models.danish_pig import DanishPig
+from petstore_api.models.deprecated_object import DeprecatedObject
+from petstore_api.models.dog import Dog
+from petstore_api.models.dog_all_of import DogAllOf
+from petstore_api.models.dummy_model import DummyModel
+from petstore_api.models.enum_arrays import EnumArrays
+from petstore_api.models.enum_class import EnumClass
+from petstore_api.models.enum_test import EnumTest
+from petstore_api.models.file import File
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+from petstore_api.models.foo import Foo
+from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
+from petstore_api.models.format_test import FormatTest
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly
+from petstore_api.models.health_check_result import HealthCheckResult
+from petstore_api.models.list import List
+from petstore_api.models.map_test import MapTest
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+from petstore_api.models.model200_response import Model200Response
+from petstore_api.models.model_return import ModelReturn
+from petstore_api.models.name import Name
+from petstore_api.models.nullable_class import NullableClass
+from petstore_api.models.number_only import NumberOnly
+from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields
+from petstore_api.models.order import Order
+from petstore_api.models.outer_composite import OuterComposite
+from petstore_api.models.outer_enum import OuterEnum
+from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue
+from petstore_api.models.outer_enum_integer import OuterEnumInteger
+from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
+from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
+from petstore_api.models.pet import Pet
+from petstore_api.models.pig import Pig
+from petstore_api.models.read_only_first import ReadOnlyFirst
+from petstore_api.models.self_reference_model import SelfReferenceModel
+from petstore_api.models.single_ref_type import SingleRefType
+from petstore_api.models.special_model_name import SpecialModelName
+from petstore_api.models.special_name import SpecialName
+from petstore_api.models.tag import Tag
+from petstore_api.models.user import User
+from petstore_api.models.with_nested_one_of import WithNestedOneOf
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/additional_properties_class.py
new file mode 100644
index 00000000000..e73e6ca7022
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/additional_properties_class.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Dict, Optional
+from pydantic import BaseModel, StrictStr
+
+class AdditionalPropertiesClass(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ map_property: Optional[Dict[str, StrictStr]] = None
+ map_of_map_property: Optional[Dict[str, Dict[str, StrictStr]]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["map_property", "map_of_map_property"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> AdditionalPropertiesClass:
+ """Create an instance of AdditionalPropertiesClass from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> AdditionalPropertiesClass:
+ """Create an instance of AdditionalPropertiesClass from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return AdditionalPropertiesClass.parse_obj(obj)
+
+ _obj = AdditionalPropertiesClass.parse_obj({
+ "map_property": obj.get("map_property"),
+ "map_of_map_property": obj.get("map_of_map_property")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/all_of_with_single_ref.py
new file mode 100644
index 00000000000..d46e7528735
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/all_of_with_single_ref.py
@@ -0,0 +1,87 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class AllOfWithSingleRef(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ username: Optional[StrictStr] = None
+ single_ref_type: Optional[Any] = Field(None, alias="SingleRefType")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["username", "SingleRefType"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> AllOfWithSingleRef:
+ """Create an instance of AllOfWithSingleRef from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of single_ref_type
+ if self.single_ref_type:
+ _dict['SingleRefType'] = self.single_ref_type.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> AllOfWithSingleRef:
+ """Create an instance of AllOfWithSingleRef from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return AllOfWithSingleRef.parse_obj(obj)
+
+ _obj = AllOfWithSingleRef.parse_obj({
+ "username": obj.get("username"),
+ "single_ref_type": SingleRefType.from_dict(obj.get("SingleRefType")) if obj.get("SingleRefType") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/animal.py
new file mode 100644
index 00000000000..e5885a40c20
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/animal.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+import petstore_api.models
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class Animal(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ class_name: StrictStr = Field(..., alias="className")
+ color: Optional[StrictStr] = 'red'
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["className", "color"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ # JSON field name that stores the object type
+ __discriminator_property_name = 'className'
+
+ # discriminator mappings
+ __discriminator_value_class_map = {
+ 'Cat': 'Cat',
+ 'Dog': 'Dog'
+ }
+
+ @classmethod
+ def get_discriminator_value(cls, obj: dict) -> str:
+ """Returns the discriminator value (object type) of the data"""
+ discriminator_value = obj[cls.__discriminator_property_name]
+ if discriminator_value:
+ return cls.__discriminator_value_class_map.get(discriminator_value)
+ else:
+ return None
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Union(Cat, Dog):
+ """Create an instance of Animal from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Union(Cat, Dog):
+ """Create an instance of Animal from a dict"""
+ # look up the object type based on discriminator mapping
+ object_type = cls.get_discriminator_value(obj)
+ if object_type:
+ klass = getattr(petstore_api.models, object_type)
+ return klass.from_dict(obj)
+ else:
+ raise ValueError("Animal failed to lookup discriminator value from " +
+ json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name +
+ ", mapping: " + json.dumps(cls.__discriminator_value_class_map))
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/any_of_pig.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/any_of_pig.py
new file mode 100644
index 00000000000..0841de93203
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/any_of_pig.py
@@ -0,0 +1,105 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr, ValidationError, validator
+from petstore_api.models.basque_pig import BasquePig
+from petstore_api.models.danish_pig import DanishPig
+from typing import Any, List
+from pydantic import StrictStr, Field
+
+ANYOFPIG_ANY_OF_SCHEMAS = ["BasquePig", "DanishPig"]
+
+class AnyOfPig(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ # data type: BasquePig
+ __anyof_schema_1: Optional[BasquePig] = None
+ # data type: DanishPig
+ __anyof_schema_2: Optional[DanishPig] = None
+ actual_instance: Any
+ any_of_schemas: List[str] = Field(ANYOFPIG_ANY_OF_SCHEMAS, const=True)
+
+ class Config:
+ validate_assignment = True
+
+ @validator('actual_instance')
+ def actual_instance_must_validate_anyof(cls, v):
+ error_messages = []
+ # validate data type: BasquePig
+ if type(v) is not BasquePig:
+ error_messages.append(f"Error! Input type `{type(v)}` is not `BasquePig`")
+ else:
+ return v
+
+ # validate data type: DanishPig
+ if type(v) is not DanishPig:
+ error_messages.append(f"Error! Input type `{type(v)}` is not `DanishPig`")
+ else:
+ return v
+
+ if error_messages:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into AnyOfPig with anyOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ else:
+ return v
+
+ @classmethod
+ def from_json(cls, json_str: str) -> AnyOfPig:
+ """Returns the object represented by the json string"""
+ instance = cls()
+ error_messages = []
+ # __anyof_schema_1: Optional[BasquePig] = None
+ try:
+ instance.actual_instance = BasquePig.from_json(json_str)
+ return instance
+ except ValidationError as e:
+ error_messages.append(str(e))
+ # __anyof_schema_2: Optional[DanishPig] = None
+ try:
+ instance.actual_instance = DanishPig.from_json(json_str)
+ return instance
+ except ValidationError as e:
+ error_messages.append(str(e))
+
+ if error_messages:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into AnyOfPig with anyOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is not None:
+ return self.actual_instance.to_json()
+ else:
+ return "null"
+
+ def to_dict(self) -> dict:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is not None:
+ return self.actual_instance.to_dict()
+ else:
+ return dict()
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.dict())
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/api_response.py
new file mode 100644
index 00000000000..ad9080c88ed
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/api_response.py
@@ -0,0 +1,86 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictInt, StrictStr
+
+class ApiResponse(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ code: Optional[StrictInt] = None
+ type: Optional[StrictStr] = None
+ message: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["code", "type", "message"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ApiResponse:
+ """Create an instance of ApiResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ApiResponse:
+ """Create an instance of ApiResponse from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return ApiResponse.parse_obj(obj)
+
+ _obj = ApiResponse.parse_obj({
+ "code": obj.get("code"),
+ "type": obj.get("type"),
+ "message": obj.get("message")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_array_of_number_only.py
new file mode 100644
index 00000000000..3ed982a658c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_array_of_number_only.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, Field, StrictFloat
+
+class ArrayOfArrayOfNumberOnly(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ array_array_number: Optional[List[List[StrictFloat]]] = Field(None, alias="ArrayArrayNumber")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["ArrayArrayNumber"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ArrayOfArrayOfNumberOnly:
+ """Create an instance of ArrayOfArrayOfNumberOnly from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ArrayOfArrayOfNumberOnly:
+ """Create an instance of ArrayOfArrayOfNumberOnly from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return ArrayOfArrayOfNumberOnly.parse_obj(obj)
+
+ _obj = ArrayOfArrayOfNumberOnly.parse_obj({
+ "array_array_number": obj.get("ArrayArrayNumber")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_number_only.py
new file mode 100644
index 00000000000..7d48697bba8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_number_only.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, Field, StrictFloat
+
+class ArrayOfNumberOnly(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ array_number: Optional[List[StrictFloat]] = Field(None, alias="ArrayNumber")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["ArrayNumber"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ArrayOfNumberOnly:
+ """Create an instance of ArrayOfNumberOnly from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ArrayOfNumberOnly:
+ """Create an instance of ArrayOfNumberOnly from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return ArrayOfNumberOnly.parse_obj(obj)
+
+ _obj = ArrayOfNumberOnly.parse_obj({
+ "array_number": obj.get("ArrayNumber")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_test.py
new file mode 100644
index 00000000000..c113981470e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_test.py
@@ -0,0 +1,94 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, StrictInt, StrictStr
+from petstore_api.models.read_only_first import ReadOnlyFirst
+
+class ArrayTest(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ array_of_string: Optional[List[StrictStr]] = None
+ array_array_of_integer: Optional[List[List[StrictInt]]] = None
+ array_array_of_model: Optional[List[List[ReadOnlyFirst]]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["array_of_string", "array_array_of_integer", "array_array_of_model"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ArrayTest:
+ """Create an instance of ArrayTest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of each item in array_array_of_model (list)
+ _items = []
+ if self.array_array_of_model:
+ for _item in self.array_array_of_model:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict['array_array_of_model'] = _items
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ArrayTest:
+ """Create an instance of ArrayTest from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return ArrayTest.parse_obj(obj)
+
+ _obj = ArrayTest.parse_obj({
+ "array_of_string": obj.get("array_of_string"),
+ "array_array_of_integer": obj.get("array_array_of_integer"),
+ "array_array_of_model": [List[ReadOnlyFirst].from_dict(_item) for _item in obj.get("array_array_of_model")] if obj.get("array_array_of_model") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/basque_pig.py
new file mode 100644
index 00000000000..2dfbf9c68e8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/basque_pig.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+
+from pydantic import BaseModel, Field, StrictStr
+
+class BasquePig(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ class_name: StrictStr = Field(..., alias="className")
+ color: StrictStr = ...
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["className", "color"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> BasquePig:
+ """Create an instance of BasquePig from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> BasquePig:
+ """Create an instance of BasquePig from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return BasquePig.parse_obj(obj)
+
+ _obj = BasquePig.parse_obj({
+ "class_name": obj.get("className"),
+ "color": obj.get("color")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/capitalization.py
new file mode 100644
index 00000000000..edf62140d5f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/capitalization.py
@@ -0,0 +1,92 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class Capitalization(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ small_camel: Optional[StrictStr] = Field(None, alias="smallCamel")
+ capital_camel: Optional[StrictStr] = Field(None, alias="CapitalCamel")
+ small_snake: Optional[StrictStr] = Field(None, alias="small_Snake")
+ capital_snake: Optional[StrictStr] = Field(None, alias="Capital_Snake")
+ sca_eth_flow_points: Optional[StrictStr] = Field(None, alias="SCA_ETH_Flow_Points")
+ att_name: Optional[StrictStr] = Field(None, alias="ATT_NAME", description="Name of the pet ")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["smallCamel", "CapitalCamel", "small_Snake", "Capital_Snake", "SCA_ETH_Flow_Points", "ATT_NAME"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Capitalization:
+ """Create an instance of Capitalization from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Capitalization:
+ """Create an instance of Capitalization from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Capitalization.parse_obj(obj)
+
+ _obj = Capitalization.parse_obj({
+ "small_camel": obj.get("smallCamel"),
+ "capital_camel": obj.get("CapitalCamel"),
+ "small_snake": obj.get("small_Snake"),
+ "capital_snake": obj.get("Capital_Snake"),
+ "sca_eth_flow_points": obj.get("SCA_ETH_Flow_Points"),
+ "att_name": obj.get("ATT_NAME")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat.py
new file mode 100644
index 00000000000..54c92e534d6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat.py
@@ -0,0 +1,85 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictBool
+from petstore_api.models.animal import Animal
+
+class Cat(Animal):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ declawed: Optional[StrictBool] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["className", "color", "declawed"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Cat:
+ """Create an instance of Cat from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Cat:
+ """Create an instance of Cat from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Cat.parse_obj(obj)
+
+ _obj = Cat.parse_obj({
+ "class_name": obj.get("className"),
+ "color": obj.get("color") if obj.get("color") is not None else 'red',
+ "declawed": obj.get("declawed")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat_all_of.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat_all_of.py
new file mode 100644
index 00000000000..17029865e8b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat_all_of.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictBool
+
+class CatAllOf(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ declawed: Optional[StrictBool] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["declawed"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> CatAllOf:
+ """Create an instance of CatAllOf from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> CatAllOf:
+ """Create an instance of CatAllOf from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return CatAllOf.parse_obj(obj)
+
+ _obj = CatAllOf.parse_obj({
+ "declawed": obj.get("declawed")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/category.py
new file mode 100644
index 00000000000..d2f04fbf284
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/category.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictInt, StrictStr
+
+class Category(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ id: Optional[StrictInt] = None
+ name: StrictStr = ...
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["id", "name"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Category:
+ """Create an instance of Category from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Category:
+ """Create an instance of Category from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Category.parse_obj(obj)
+
+ _obj = Category.parse_obj({
+ "id": obj.get("id"),
+ "name": obj.get("name") if obj.get("name") is not None else 'default-name'
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/class_model.py
new file mode 100644
index 00000000000..6a10ec1d707
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/class_model.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class ClassModel(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ var_class: Optional[StrictStr] = Field(None, alias="_class")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["_class"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ClassModel:
+ """Create an instance of ClassModel from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ClassModel:
+ """Create an instance of ClassModel from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return ClassModel.parse_obj(obj)
+
+ _obj = ClassModel.parse_obj({
+ "var_class": obj.get("_class")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/client.py
new file mode 100644
index 00000000000..811d6be903c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/client.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+
+class Client(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ client: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["client"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Client:
+ """Create an instance of Client from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Client:
+ """Create an instance of Client from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Client.parse_obj(obj)
+
+ _obj = Client.parse_obj({
+ "client": obj.get("client")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/danish_pig.py
new file mode 100644
index 00000000000..0f9aa3c03c6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/danish_pig.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+
+class DanishPig(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ class_name: StrictStr = Field(..., alias="className")
+ size: StrictInt = ...
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["className", "size"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DanishPig:
+ """Create an instance of DanishPig from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> DanishPig:
+ """Create an instance of DanishPig from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return DanishPig.parse_obj(obj)
+
+ _obj = DanishPig.parse_obj({
+ "class_name": obj.get("className"),
+ "size": obj.get("size")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/deprecated_object.py
new file mode 100644
index 00000000000..40e4919b342
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/deprecated_object.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+
+class DeprecatedObject(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ name: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["name"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DeprecatedObject:
+ """Create an instance of DeprecatedObject from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> DeprecatedObject:
+ """Create an instance of DeprecatedObject from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return DeprecatedObject.parse_obj(obj)
+
+ _obj = DeprecatedObject.parse_obj({
+ "name": obj.get("name")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog.py
new file mode 100644
index 00000000000..9465c10bfdc
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog.py
@@ -0,0 +1,85 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+from petstore_api.models.animal import Animal
+
+class Dog(Animal):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ breed: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["className", "color", "breed"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Dog:
+ """Create an instance of Dog from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Dog:
+ """Create an instance of Dog from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Dog.parse_obj(obj)
+
+ _obj = Dog.parse_obj({
+ "class_name": obj.get("className"),
+ "color": obj.get("color") if obj.get("color") is not None else 'red',
+ "breed": obj.get("breed")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog_all_of.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog_all_of.py
new file mode 100644
index 00000000000..526dd6c3578
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog_all_of.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+
+class DogAllOf(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ breed: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["breed"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DogAllOf:
+ """Create an instance of DogAllOf from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> DogAllOf:
+ """Create an instance of DogAllOf from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return DogAllOf.parse_obj(obj)
+
+ _obj = DogAllOf.parse_obj({
+ "breed": obj.get("breed")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dummy_model.py
new file mode 100644
index 00000000000..ef11b61a2ea
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dummy_model.py
@@ -0,0 +1,87 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+
+class DummyModel(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ category: Optional[StrictStr] = None
+ self_ref: Optional[SelfReferenceModel] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["category", "self_ref"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DummyModel:
+ """Create an instance of DummyModel from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of self_ref
+ if self.self_ref:
+ _dict['self_ref'] = self.self_ref.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> DummyModel:
+ """Create an instance of DummyModel from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return DummyModel.parse_obj(obj)
+
+ _obj = DummyModel.parse_obj({
+ "category": obj.get("category"),
+ "self_ref": SelfReferenceModel.from_dict(obj.get("self_ref")) if obj.get("self_ref") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_arrays.py
new file mode 100644
index 00000000000..75ec36fba52
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_arrays.py
@@ -0,0 +1,102 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, StrictStr, validator
+
+class EnumArrays(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ just_symbol: Optional[StrictStr] = None
+ array_enum: Optional[List[StrictStr]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["just_symbol", "array_enum"]
+
+ @validator('just_symbol')
+ def just_symbol_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in ('>=', '$'):
+ raise ValueError("must validate the enum values ('>=', '$')")
+ return v
+
+ @validator('array_enum')
+ def array_enum_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in ('fish', 'crab'):
+ raise ValueError("must validate the enum values ('fish', 'crab')")
+ return v
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> EnumArrays:
+ """Create an instance of EnumArrays from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> EnumArrays:
+ """Create an instance of EnumArrays from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return EnumArrays.parse_obj(obj)
+
+ _obj = EnumArrays.parse_obj({
+ "just_symbol": obj.get("just_symbol"),
+ "array_enum": obj.get("array_enum")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_class.py
new file mode 100644
index 00000000000..24336123fa3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_class.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class EnumClass(str, Enum):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ """
+ allowed enum values
+ """
+
+ ABC = '_abc'
+ EFG = '-efg'
+ XYZ = '(xyz)'
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_test.py
new file mode 100644
index 00000000000..3917e3f0312
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_test.py
@@ -0,0 +1,137 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator
+from petstore_api.models.outer_enum import OuterEnum
+from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue
+from petstore_api.models.outer_enum_integer import OuterEnumInteger
+from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
+
+class EnumTest(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ enum_string: Optional[StrictStr] = None
+ enum_string_required: StrictStr = ...
+ enum_integer: Optional[StrictInt] = None
+ enum_number: Optional[StrictFloat] = None
+ outer_enum: Optional[OuterEnum] = Field(None, alias="outerEnum")
+ outer_enum_integer: Optional[OuterEnumInteger] = Field(None, alias="outerEnumInteger")
+ outer_enum_default_value: Optional[OuterEnumDefaultValue] = Field(None, alias="outerEnumDefaultValue")
+ outer_enum_integer_default_value: Optional[OuterEnumIntegerDefaultValue] = Field(None, alias="outerEnumIntegerDefaultValue")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["enum_string", "enum_string_required", "enum_integer", "enum_number", "outerEnum", "outerEnumInteger", "outerEnumDefaultValue", "outerEnumIntegerDefaultValue"]
+
+ @validator('enum_string')
+ def enum_string_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in ('UPPER', 'lower', ''):
+ raise ValueError("must validate the enum values ('UPPER', 'lower', '')")
+ return v
+
+ @validator('enum_string_required')
+ def enum_string_required_validate_enum(cls, v):
+ if v not in ('UPPER', 'lower', ''):
+ raise ValueError("must validate the enum values ('UPPER', 'lower', '')")
+ return v
+
+ @validator('enum_integer')
+ def enum_integer_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in (1, -1):
+ raise ValueError("must validate the enum values (1, -1)")
+ return v
+
+ @validator('enum_number')
+ def enum_number_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in (1.1, -1.2):
+ raise ValueError("must validate the enum values (1.1, -1.2)")
+ return v
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> EnumTest:
+ """Create an instance of EnumTest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if outer_enum (nullable) is None
+ if self.outer_enum is None:
+ _dict['outerEnum'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> EnumTest:
+ """Create an instance of EnumTest from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return EnumTest.parse_obj(obj)
+
+ _obj = EnumTest.parse_obj({
+ "enum_string": obj.get("enum_string"),
+ "enum_string_required": obj.get("enum_string_required"),
+ "enum_integer": obj.get("enum_integer"),
+ "enum_number": obj.get("enum_number"),
+ "outer_enum": obj.get("outerEnum"),
+ "outer_enum_integer": obj.get("outerEnumInteger"),
+ "outer_enum_default_value": obj.get("outerEnumDefaultValue"),
+ "outer_enum_integer_default_value": obj.get("outerEnumIntegerDefaultValue")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file.py
new file mode 100644
index 00000000000..6217ee78824
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class File(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ source_uri: Optional[StrictStr] = Field(None, alias="sourceURI", description="Test capitalization")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["sourceURI"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> File:
+ """Create an instance of File from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> File:
+ """Create an instance of File from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return File.parse_obj(obj)
+
+ _obj = File.parse_obj({
+ "source_uri": obj.get("sourceURI")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file_schema_test_class.py
new file mode 100644
index 00000000000..fd23428cfa9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file_schema_test_class.py
@@ -0,0 +1,95 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel
+from petstore_api.models.file import File
+
+class FileSchemaTestClass(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ file: Optional[File] = None
+ files: Optional[List[File]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["file", "files"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> FileSchemaTestClass:
+ """Create an instance of FileSchemaTestClass from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of file
+ if self.file:
+ _dict['file'] = self.file.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of each item in files (list)
+ _items = []
+ if self.files:
+ for _item in self.files:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict['files'] = _items
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> FileSchemaTestClass:
+ """Create an instance of FileSchemaTestClass from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return FileSchemaTestClass.parse_obj(obj)
+
+ _obj = FileSchemaTestClass.parse_obj({
+ "file": File.from_dict(obj.get("file")) if obj.get("file") is not None else None,
+ "files": [File.from_dict(_item) for _item in obj.get("files")] if obj.get("files") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo.py
new file mode 100644
index 00000000000..bcb183fae04
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+
+class Foo(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ bar: Optional[StrictStr] = 'bar'
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["bar"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Foo:
+ """Create an instance of Foo from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Foo:
+ """Create an instance of Foo from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Foo.parse_obj(obj)
+
+ _obj = Foo.parse_obj({
+ "bar": obj.get("bar") if obj.get("bar") is not None else 'bar'
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo_get_default_response.py
new file mode 100644
index 00000000000..0cb3f6286e1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo_get_default_response.py
@@ -0,0 +1,86 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel
+from petstore_api.models.foo import Foo
+
+class FooGetDefaultResponse(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ string: Optional[Foo] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["string"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> FooGetDefaultResponse:
+ """Create an instance of FooGetDefaultResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of string
+ if self.string:
+ _dict['string'] = self.string.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> FooGetDefaultResponse:
+ """Create an instance of FooGetDefaultResponse from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return FooGetDefaultResponse.parse_obj(obj)
+
+ _obj = FooGetDefaultResponse.parse_obj({
+ "string": Foo.from_dict(obj.get("string")) if obj.get("string") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/format_test.py
new file mode 100644
index 00000000000..32793444b59
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/format_test.py
@@ -0,0 +1,130 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import date, datetime
+from typing import Optional
+from pydantic import BaseModel, Field, StrictBytes, StrictInt, StrictStr, condecimal, confloat, conint, constr, validator
+
+class FormatTest(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ integer: Optional[conint(strict=True, le=100, ge=10)] = None
+ int32: Optional[conint(strict=True, le=200, ge=20)] = None
+ int64: Optional[StrictInt] = None
+ number: confloat(strict=True, le=543.2, ge=32.1) = ...
+ float: Optional[confloat(strict=True, le=987.6, ge=54.3)] = None
+ double: Optional[confloat(strict=True, le=123.4, ge=67.8)] = None
+ decimal: Optional[condecimal()] = None
+ string: Optional[constr(strict=True)] = None
+ byte: StrictBytes = ...
+ binary: Optional[StrictBytes] = None
+ var_date: date = Field(..., alias="date")
+ date_time: Optional[datetime] = Field(None, alias="dateTime")
+ uuid: Optional[StrictStr] = None
+ password: constr(strict=True, max_length=64, min_length=10) = ...
+ pattern_with_digits: Optional[constr(strict=True)] = Field(None, description="A string that is a 10 digit number. Can have leading zeros.")
+ pattern_with_digits_and_delimiter: Optional[constr(strict=True)] = Field(None, description="A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["integer", "int32", "int64", "number", "float", "double", "decimal", "string", "byte", "binary", "date", "dateTime", "uuid", "password", "pattern_with_digits", "pattern_with_digits_and_delimiter"]
+
+ @validator('string')
+ def string_validate_regular_expression(cls, v):
+ if not re.match(r"[a-z]", v ,re.IGNORECASE):
+ raise ValueError(r"must validate the regular expression /[a-z]/i")
+ return v
+
+ @validator('pattern_with_digits')
+ def pattern_with_digits_validate_regular_expression(cls, v):
+ if not re.match(r"^\d{10}$", v):
+ raise ValueError(r"must validate the regular expression /^\d{10}$/")
+ return v
+
+ @validator('pattern_with_digits_and_delimiter')
+ def pattern_with_digits_and_delimiter_validate_regular_expression(cls, v):
+ if not re.match(r"^image_\d{1,3}$", v ,re.IGNORECASE):
+ raise ValueError(r"must validate the regular expression /^image_\d{1,3}$/i")
+ return v
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> FormatTest:
+ """Create an instance of FormatTest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> FormatTest:
+ """Create an instance of FormatTest from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return FormatTest.parse_obj(obj)
+
+ _obj = FormatTest.parse_obj({
+ "integer": obj.get("integer"),
+ "int32": obj.get("int32"),
+ "int64": obj.get("int64"),
+ "number": obj.get("number"),
+ "float": obj.get("float"),
+ "double": obj.get("double"),
+ "decimal": obj.get("decimal"),
+ "string": obj.get("string"),
+ "byte": obj.get("byte"),
+ "binary": obj.get("binary"),
+ "var_date": obj.get("date"),
+ "date_time": obj.get("dateTime"),
+ "uuid": obj.get("uuid"),
+ "password": obj.get("password"),
+ "pattern_with_digits": obj.get("pattern_with_digits"),
+ "pattern_with_digits_and_delimiter": obj.get("pattern_with_digits_and_delimiter")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/has_only_read_only.py
new file mode 100644
index 00000000000..9a236e34bf1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/has_only_read_only.py
@@ -0,0 +1,86 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+
+class HasOnlyReadOnly(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ bar: Optional[StrictStr] = None
+ foo: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["bar", "foo"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> HasOnlyReadOnly:
+ """Create an instance of HasOnlyReadOnly from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "bar",
+ "foo",
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> HasOnlyReadOnly:
+ """Create an instance of HasOnlyReadOnly from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return HasOnlyReadOnly.parse_obj(obj)
+
+ _obj = HasOnlyReadOnly.parse_obj({
+ "bar": obj.get("bar"),
+ "foo": obj.get("foo")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/health_check_result.py
new file mode 100644
index 00000000000..d6d2aca0baa
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/health_check_result.py
@@ -0,0 +1,86 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class HealthCheckResult(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ nullable_message: Optional[StrictStr] = Field(None, alias="NullableMessage")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["NullableMessage"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> HealthCheckResult:
+ """Create an instance of HealthCheckResult from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if nullable_message (nullable) is None
+ if self.nullable_message is None:
+ _dict['NullableMessage'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> HealthCheckResult:
+ """Create an instance of HealthCheckResult from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return HealthCheckResult.parse_obj(obj)
+
+ _obj = HealthCheckResult.parse_obj({
+ "nullable_message": obj.get("NullableMessage")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/list.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/list.py
new file mode 100644
index 00000000000..bd0b49bc447
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/list.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class List(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ var_123_list: Optional[StrictStr] = Field(None, alias="123-list")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["123-list"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> List:
+ """Create an instance of List from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> List:
+ """Create an instance of List from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return List.parse_obj(obj)
+
+ _obj = List.parse_obj({
+ "var_123_list": obj.get("123-list")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/map_test.py
new file mode 100644
index 00000000000..679a29dc053
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/map_test.py
@@ -0,0 +1,97 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Dict, Optional
+from pydantic import BaseModel, StrictBool, StrictStr, validator
+
+class MapTest(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ map_map_of_string: Optional[Dict[str, Dict[str, StrictStr]]] = None
+ map_of_enum_string: Optional[Dict[str, StrictStr]] = None
+ direct_map: Optional[Dict[str, StrictBool]] = None
+ indirect_map: Optional[Dict[str, StrictBool]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["map_map_of_string", "map_of_enum_string", "direct_map", "indirect_map"]
+
+ @validator('map_of_enum_string')
+ def map_of_enum_string_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in ('UPPER', 'lower'):
+ raise ValueError("must validate the enum values ('UPPER', 'lower')")
+ return v
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MapTest:
+ """Create an instance of MapTest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MapTest:
+ """Create an instance of MapTest from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return MapTest.parse_obj(obj)
+
+ _obj = MapTest.parse_obj({
+ "map_map_of_string": obj.get("map_map_of_string"),
+ "map_of_enum_string": obj.get("map_of_enum_string"),
+ "direct_map": obj.get("direct_map"),
+ "indirect_map": obj.get("indirect_map")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/mixed_properties_and_additional_properties_class.py
new file mode 100644
index 00000000000..633dbf1da8d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/mixed_properties_and_additional_properties_class.py
@@ -0,0 +1,94 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from petstore_api.models.animal import Animal
+
+class MixedPropertiesAndAdditionalPropertiesClass(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ uuid: Optional[StrictStr] = None
+ date_time: Optional[datetime] = Field(None, alias="dateTime")
+ map: Optional[Dict[str, Animal]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["uuid", "dateTime", "map"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MixedPropertiesAndAdditionalPropertiesClass:
+ """Create an instance of MixedPropertiesAndAdditionalPropertiesClass from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of each value in map (dict)
+ _field_dict = {}
+ if self.map:
+ for _key in self.map:
+ if self.map[_key]:
+ _field_dict[_key] = self.map[_key].to_dict()
+ _dict['map'] = _field_dict
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MixedPropertiesAndAdditionalPropertiesClass:
+ """Create an instance of MixedPropertiesAndAdditionalPropertiesClass from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return MixedPropertiesAndAdditionalPropertiesClass.parse_obj(obj)
+
+ _obj = MixedPropertiesAndAdditionalPropertiesClass.parse_obj({
+ "uuid": obj.get("uuid"),
+ "date_time": obj.get("dateTime"),
+ "map": dict((_k, Dict[str, Animal].from_dict(_v)) for _k, _v in obj.get("map").items())
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model200_response.py
new file mode 100644
index 00000000000..c6f91f79c3f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model200_response.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+
+class Model200Response(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ name: Optional[StrictInt] = None
+ var_class: Optional[StrictStr] = Field(None, alias="class")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["name", "class"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Model200Response:
+ """Create an instance of Model200Response from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Model200Response:
+ """Create an instance of Model200Response from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Model200Response.parse_obj(obj)
+
+ _obj = Model200Response.parse_obj({
+ "name": obj.get("name"),
+ "var_class": obj.get("class")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model_return.py
new file mode 100644
index 00000000000..53ffd8c2617
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model_return.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictInt
+
+class ModelReturn(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ var_return: Optional[StrictInt] = Field(None, alias="return")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["return"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ModelReturn:
+ """Create an instance of ModelReturn from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ModelReturn:
+ """Create an instance of ModelReturn from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return ModelReturn.parse_obj(obj)
+
+ _obj = ModelReturn.parse_obj({
+ "var_return": obj.get("return")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/name.py
new file mode 100644
index 00000000000..0c48837381d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/name.py
@@ -0,0 +1,90 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+
+class Name(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ name: StrictInt = ...
+ snake_case: Optional[StrictInt] = None
+ var_property: Optional[StrictStr] = Field(None, alias="property")
+ var_123_number: Optional[StrictInt] = Field(None, alias="123Number")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["name", "snake_case", "property", "123Number"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Name:
+ """Create an instance of Name from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "snake_case",
+ "var_123_number",
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Name:
+ """Create an instance of Name from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Name.parse_obj(obj)
+
+ _obj = Name.parse_obj({
+ "name": obj.get("name"),
+ "snake_case": obj.get("snake_case"),
+ "var_property": obj.get("property"),
+ "var_123_number": obj.get("123Number")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/nullable_class.py
new file mode 100644
index 00000000000..449bb066f72
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/nullable_class.py
@@ -0,0 +1,138 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import date, datetime
+from typing import Any, Dict, List, Optional
+from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr
+
+class NullableClass(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ required_integer_prop: Optional[StrictInt] = ...
+ integer_prop: Optional[StrictInt] = None
+ number_prop: Optional[StrictFloat] = None
+ boolean_prop: Optional[StrictBool] = None
+ string_prop: Optional[StrictStr] = None
+ date_prop: Optional[date] = None
+ datetime_prop: Optional[datetime] = None
+ array_nullable_prop: Optional[List[Dict[str, Any]]] = None
+ array_and_items_nullable_prop: Optional[List[Dict[str, Any]]] = None
+ array_items_nullable: Optional[List[Dict[str, Any]]] = None
+ object_nullable_prop: Optional[Dict[str, Dict[str, Any]]] = None
+ object_and_items_nullable_prop: Optional[Dict[str, Dict[str, Any]]] = None
+ object_items_nullable: Optional[Dict[str, Dict[str, Any]]] = None
+ __properties = ["required_integer_prop", "integer_prop", "number_prop", "boolean_prop", "string_prop", "date_prop", "datetime_prop", "array_nullable_prop", "array_and_items_nullable_prop", "array_items_nullable", "object_nullable_prop", "object_and_items_nullable_prop", "object_items_nullable"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> NullableClass:
+ """Create an instance of NullableClass from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # set to None if required_integer_prop (nullable) is None
+ if self.required_integer_prop is None:
+ _dict['required_integer_prop'] = None
+
+ # set to None if integer_prop (nullable) is None
+ if self.integer_prop is None:
+ _dict['integer_prop'] = None
+
+ # set to None if number_prop (nullable) is None
+ if self.number_prop is None:
+ _dict['number_prop'] = None
+
+ # set to None if boolean_prop (nullable) is None
+ if self.boolean_prop is None:
+ _dict['boolean_prop'] = None
+
+ # set to None if string_prop (nullable) is None
+ if self.string_prop is None:
+ _dict['string_prop'] = None
+
+ # set to None if date_prop (nullable) is None
+ if self.date_prop is None:
+ _dict['date_prop'] = None
+
+ # set to None if datetime_prop (nullable) is None
+ if self.datetime_prop is None:
+ _dict['datetime_prop'] = None
+
+ # set to None if array_nullable_prop (nullable) is None
+ if self.array_nullable_prop is None:
+ _dict['array_nullable_prop'] = None
+
+ # set to None if array_and_items_nullable_prop (nullable) is None
+ if self.array_and_items_nullable_prop is None:
+ _dict['array_and_items_nullable_prop'] = None
+
+ # set to None if object_nullable_prop (nullable) is None
+ if self.object_nullable_prop is None:
+ _dict['object_nullable_prop'] = None
+
+ # set to None if object_and_items_nullable_prop (nullable) is None
+ if self.object_and_items_nullable_prop is None:
+ _dict['object_and_items_nullable_prop'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> NullableClass:
+ """Create an instance of NullableClass from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return NullableClass.parse_obj(obj)
+
+ _obj = NullableClass.parse_obj({
+ "required_integer_prop": obj.get("required_integer_prop"),
+ "integer_prop": obj.get("integer_prop"),
+ "number_prop": obj.get("number_prop"),
+ "boolean_prop": obj.get("boolean_prop"),
+ "string_prop": obj.get("string_prop"),
+ "date_prop": obj.get("date_prop"),
+ "datetime_prop": obj.get("datetime_prop"),
+ "array_nullable_prop": obj.get("array_nullable_prop"),
+ "array_and_items_nullable_prop": obj.get("array_and_items_nullable_prop"),
+ "array_items_nullable": obj.get("array_items_nullable"),
+ "object_nullable_prop": obj.get("object_nullable_prop"),
+ "object_and_items_nullable_prop": obj.get("object_and_items_nullable_prop"),
+ "object_items_nullable": obj.get("object_items_nullable")
+ })
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/number_only.py
new file mode 100644
index 00000000000..563edbe9c86
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/number_only.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictFloat
+
+class NumberOnly(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ just_number: Optional[StrictFloat] = Field(None, alias="JustNumber")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["JustNumber"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> NumberOnly:
+ """Create an instance of NumberOnly from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> NumberOnly:
+ """Create an instance of NumberOnly from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return NumberOnly.parse_obj(obj)
+
+ _obj = NumberOnly.parse_obj({
+ "just_number": obj.get("JustNumber")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/object_with_deprecated_fields.py
new file mode 100644
index 00000000000..aab3c82f09d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/object_with_deprecated_fields.py
@@ -0,0 +1,92 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, Field, StrictFloat, StrictStr
+from petstore_api.models.deprecated_object import DeprecatedObject
+
+class ObjectWithDeprecatedFields(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ uuid: Optional[StrictStr] = None
+ id: Optional[StrictFloat] = None
+ deprecated_ref: Optional[DeprecatedObject] = Field(None, alias="deprecatedRef")
+ bars: Optional[List[StrictStr]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["uuid", "id", "deprecatedRef", "bars"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ObjectWithDeprecatedFields:
+ """Create an instance of ObjectWithDeprecatedFields from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of deprecated_ref
+ if self.deprecated_ref:
+ _dict['deprecatedRef'] = self.deprecated_ref.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ObjectWithDeprecatedFields:
+ """Create an instance of ObjectWithDeprecatedFields from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return ObjectWithDeprecatedFields.parse_obj(obj)
+
+ _obj = ObjectWithDeprecatedFields.parse_obj({
+ "uuid": obj.get("uuid"),
+ "id": obj.get("id"),
+ "deprecated_ref": DeprecatedObject.from_dict(obj.get("deprecatedRef")) if obj.get("deprecatedRef") is not None else None,
+ "bars": obj.get("bars")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/order.py
new file mode 100644
index 00000000000..ff917f3ff06
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/order.py
@@ -0,0 +1,101 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Optional
+from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator
+
+class Order(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ id: Optional[StrictInt] = None
+ pet_id: Optional[StrictInt] = Field(None, alias="petId")
+ quantity: Optional[StrictInt] = None
+ ship_date: Optional[datetime] = Field(None, alias="shipDate")
+ status: Optional[StrictStr] = Field(None, description="Order Status")
+ complete: Optional[StrictBool] = False
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["id", "petId", "quantity", "shipDate", "status", "complete"]
+
+ @validator('status')
+ def status_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in ('placed', 'approved', 'delivered'):
+ raise ValueError("must validate the enum values ('placed', 'approved', 'delivered')")
+ return v
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Order:
+ """Create an instance of Order from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Order:
+ """Create an instance of Order from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Order.parse_obj(obj)
+
+ _obj = Order.parse_obj({
+ "id": obj.get("id"),
+ "pet_id": obj.get("petId"),
+ "quantity": obj.get("quantity"),
+ "ship_date": obj.get("shipDate"),
+ "status": obj.get("status"),
+ "complete": obj.get("complete") if obj.get("complete") is not None else False
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_composite.py
new file mode 100644
index 00000000000..609e6edc4f7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_composite.py
@@ -0,0 +1,86 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictBool, StrictFloat, StrictStr
+
+class OuterComposite(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ my_number: Optional[StrictFloat] = None
+ my_string: Optional[StrictStr] = None
+ my_boolean: Optional[StrictBool] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["my_number", "my_string", "my_boolean"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> OuterComposite:
+ """Create an instance of OuterComposite from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> OuterComposite:
+ """Create an instance of OuterComposite from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return OuterComposite.parse_obj(obj)
+
+ _obj = OuterComposite.parse_obj({
+ "my_number": obj.get("my_number"),
+ "my_string": obj.get("my_string"),
+ "my_boolean": obj.get("my_boolean")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum.py
new file mode 100644
index 00000000000..179e822d35d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class OuterEnum(str, Enum):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ """
+ allowed enum values
+ """
+
+ PLACED = 'placed'
+ APPROVED = 'approved'
+ DELIVERED = 'delivered'
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_default_value.py
new file mode 100644
index 00000000000..4a93cbda580
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_default_value.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class OuterEnumDefaultValue(str, Enum):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ """
+ allowed enum values
+ """
+
+ PLACED = 'placed'
+ APPROVED = 'approved'
+ DELIVERED = 'delivered'
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_integer.py
new file mode 100644
index 00000000000..4a4347e3106
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_integer.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class OuterEnumInteger(int, Enum):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ """
+ allowed enum values
+ """
+
+ NUMBER_0 = 0
+ NUMBER_1 = 1
+ NUMBER_2 = 2
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_integer_default_value.py
new file mode 100644
index 00000000000..b0e86076d16
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_integer_default_value.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class OuterEnumIntegerDefaultValue(int, Enum):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ """
+ allowed enum values
+ """
+
+ NUMBER_0 = 0
+ NUMBER_1 = 1
+ NUMBER_2 = 2
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_object_with_enum_property.py
new file mode 100644
index 00000000000..049fa5026e7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_object_with_enum_property.py
@@ -0,0 +1,90 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel
+from petstore_api.models.outer_enum import OuterEnum
+from petstore_api.models.outer_enum_integer import OuterEnumInteger
+
+class OuterObjectWithEnumProperty(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ str_value: Optional[OuterEnum] = None
+ value: OuterEnumInteger = ...
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["str_value", "value"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> OuterObjectWithEnumProperty:
+ """Create an instance of OuterObjectWithEnumProperty from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if str_value (nullable) is None
+ if self.str_value is None:
+ _dict['str_value'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> OuterObjectWithEnumProperty:
+ """Create an instance of OuterObjectWithEnumProperty from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return OuterObjectWithEnumProperty.parse_obj(obj)
+
+ _obj = OuterObjectWithEnumProperty.parse_obj({
+ "str_value": obj.get("str_value"),
+ "value": obj.get("value")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pet.py
new file mode 100644
index 00000000000..962894972b1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pet.py
@@ -0,0 +1,113 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr, validator
+from petstore_api.models.category import Category
+from petstore_api.models.tag import Tag
+
+class Pet(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ id: Optional[StrictInt] = None
+ category: Optional[Category] = None
+ name: StrictStr = ...
+ photo_urls: List[StrictStr] = Field(..., alias="photoUrls", unique_items=True)
+ tags: Optional[List[Tag]] = None
+ status: Optional[StrictStr] = Field(None, description="pet status in the store")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["id", "category", "name", "photoUrls", "tags", "status"]
+
+ @validator('status')
+ def status_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in ('available', 'pending', 'sold'):
+ raise ValueError("must validate the enum values ('available', 'pending', 'sold')")
+ return v
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Pet:
+ """Create an instance of Pet from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of category
+ if self.category:
+ _dict['category'] = self.category.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of each item in tags (list)
+ _items = []
+ if self.tags:
+ for _item in self.tags:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict['tags'] = _items
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Pet:
+ """Create an instance of Pet from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Pet.parse_obj(obj)
+
+ _obj = Pet.parse_obj({
+ "id": obj.get("id"),
+ "category": Category.from_dict(obj.get("category")) if obj.get("category") is not None else None,
+ "name": obj.get("name"),
+ "photo_urls": obj.get("photoUrls"),
+ "tags": [Tag.from_dict(_item) for _item in obj.get("tags")] if obj.get("tags") is not None else None,
+ "status": obj.get("status")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pig.py
new file mode 100644
index 00000000000..e4ec570fe82
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pig.py
@@ -0,0 +1,141 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import json
+import re # noqa: F401
+
+from typing import Any, List, Optional
+from pydantic import BaseModel, Field, StrictStr, ValidationError, validator
+from petstore_api.models.basque_pig import BasquePig
+from petstore_api.models.danish_pig import DanishPig
+from typing import Any, List
+from pydantic import StrictStr, Field
+
+PIG_ONE_OF_SCHEMAS = ["BasquePig", "DanishPig"]
+
+class Pig(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ # data type: BasquePig
+ __oneof_schema_1: Optional[BasquePig] = None
+ # data type: DanishPig
+ __oneof_schema_2: Optional[DanishPig] = None
+ actual_instance: Any
+ one_of_schemas: List[str] = Field(PIG_ONE_OF_SCHEMAS, const=True)
+
+ class Config:
+ validate_assignment = True
+
+ discriminator_value_class_map = {
+ }
+
+ @validator('actual_instance')
+ def actual_instance_must_validate_oneof(cls, v):
+ error_messages = []
+ match = 0
+ # validate data type: BasquePig
+ if type(v) is not BasquePig:
+ error_messages.append(f"Error! Input type `{type(v)}` is not `BasquePig`")
+ else:
+ match += 1
+
+ # validate data type: DanishPig
+ if type(v) is not DanishPig:
+ error_messages.append(f"Error! Input type `{type(v)}` is not `DanishPig`")
+ else:
+ match += 1
+
+ if match > 1:
+ # more than 1 match
+ raise ValueError("Multiple matches found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ elif match == 0:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ else:
+ return v
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Pig:
+ return cls.from_json(json.dumps(obj))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Pig:
+ """Returns the object represented by the json string"""
+ instance = cls()
+ error_messages = []
+ match = 0
+
+ # use oneOf discriminator to lookup the data type
+ _data_type = json.loads(json_str).get("className")
+ if not _data_type:
+ raise ValueError("Failed to lookup data type from the field `className` in the input.")
+
+ # check if data type is `BasquePig`
+ if _data_type == "BasquePig":
+ instance.actual_instance = BasquePig.from_json(json_str)
+ return instance
+
+ # check if data type is `DanishPig`
+ if _data_type == "DanishPig":
+ instance.actual_instance = DanishPig.from_json(json_str)
+ return instance
+
+ # deserialize data into BasquePig
+ try:
+ instance.actual_instance = BasquePig.from_json(json_str)
+ match += 1
+ except ValidationError as e:
+ error_messages.append(str(e))
+ # deserialize data into DanishPig
+ try:
+ instance.actual_instance = DanishPig.from_json(json_str)
+ match += 1
+ except ValidationError as e:
+ error_messages.append(str(e))
+
+ if match > 1:
+ # more than 1 match
+ raise ValueError("Multiple matches found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ elif match == 0:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is not None:
+ return self.actual_instance.to_json()
+ else:
+ return "null"
+
+ def to_dict(self) -> dict:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is not None:
+ return self.actual_instance.to_dict()
+ else:
+ return dict()
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.dict())
+
+
+
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/read_only_first.py
new file mode 100644
index 00000000000..5323927c4c3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/read_only_first.py
@@ -0,0 +1,85 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictStr
+
+class ReadOnlyFirst(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ bar: Optional[StrictStr] = None
+ baz: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["bar", "baz"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ReadOnlyFirst:
+ """Create an instance of ReadOnlyFirst from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "bar",
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ReadOnlyFirst:
+ """Create an instance of ReadOnlyFirst from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return ReadOnlyFirst.parse_obj(obj)
+
+ _obj = ReadOnlyFirst.parse_obj({
+ "bar": obj.get("bar"),
+ "baz": obj.get("baz")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/self_reference_model.py
new file mode 100644
index 00000000000..c97efa222a4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/self_reference_model.py
@@ -0,0 +1,87 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictInt
+
+class SelfReferenceModel(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ size: Optional[StrictInt] = None
+ nested: Optional[DummyModel] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["size", "nested"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> SelfReferenceModel:
+ """Create an instance of SelfReferenceModel from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of nested
+ if self.nested:
+ _dict['nested'] = self.nested.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> SelfReferenceModel:
+ """Create an instance of SelfReferenceModel from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return SelfReferenceModel.parse_obj(obj)
+
+ _obj = SelfReferenceModel.parse_obj({
+ "size": obj.get("size"),
+ "nested": DummyModel.from_dict(obj.get("nested")) if obj.get("nested") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/single_ref_type.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/single_ref_type.py
new file mode 100644
index 00000000000..67ae5e41be3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/single_ref_type.py
@@ -0,0 +1,35 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class SingleRefType(str, Enum):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ """
+ allowed enum values
+ """
+
+ ADMIN = 'admin'
+ USER = 'user'
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_model_name.py
new file mode 100644
index 00000000000..aeb308dd45b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_model_name.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictInt
+
+class SpecialModelName(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ special_property_name: Optional[StrictInt] = Field(None, alias="$special[property.name]")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["$special[property.name]"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> SpecialModelName:
+ """Create an instance of SpecialModelName from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> SpecialModelName:
+ """Create an instance of SpecialModelName from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return SpecialModelName.parse_obj(obj)
+
+ _obj = SpecialModelName.parse_obj({
+ "special_property_name": obj.get("$special[property.name]")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_name.py
new file mode 100644
index 00000000000..bd3b377e886
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_name.py
@@ -0,0 +1,99 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr, validator
+from petstore_api.models.category import Category
+
+class SpecialName(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ var_property: Optional[StrictInt] = Field(None, alias="property")
+ var_async: Optional[Category] = Field(None, alias="async")
+ var_schema: Optional[StrictStr] = Field(None, alias="schema", description="pet status in the store")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["property", "async", "schema"]
+
+ @validator('var_schema')
+ def var_schema_validate_enum(cls, v):
+ if v is None:
+ return v
+
+ if v not in ('available', 'pending', 'sold'):
+ raise ValueError("must validate the enum values ('available', 'pending', 'sold')")
+ return v
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> SpecialName:
+ """Create an instance of SpecialName from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of var_async
+ if self.var_async:
+ _dict['async'] = self.var_async.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> SpecialName:
+ """Create an instance of SpecialName from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return SpecialName.parse_obj(obj)
+
+ _obj = SpecialName.parse_obj({
+ "var_property": obj.get("property"),
+ "var_async": Category.from_dict(obj.get("async")) if obj.get("async") is not None else None,
+ "var_schema": obj.get("schema")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/tag.py
new file mode 100644
index 00000000000..b3af7e9e49c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/tag.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictInt, StrictStr
+
+class Tag(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ id: Optional[StrictInt] = None
+ name: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["id", "name"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Tag:
+ """Create an instance of Tag from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Tag:
+ """Create an instance of Tag from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return Tag.parse_obj(obj)
+
+ _obj = Tag.parse_obj({
+ "id": obj.get("id"),
+ "name": obj.get("name")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/user.py
new file mode 100644
index 00000000000..6426d6c8aee
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/user.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+
+class User(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ id: Optional[StrictInt] = None
+ username: Optional[StrictStr] = None
+ first_name: Optional[StrictStr] = Field(None, alias="firstName")
+ last_name: Optional[StrictStr] = Field(None, alias="lastName")
+ email: Optional[StrictStr] = None
+ password: Optional[StrictStr] = None
+ phone: Optional[StrictStr] = None
+ user_status: Optional[StrictInt] = Field(None, alias="userStatus", description="User Status")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> User:
+ """Create an instance of User from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> User:
+ """Create an instance of User from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return User.parse_obj(obj)
+
+ _obj = User.parse_obj({
+ "id": obj.get("id"),
+ "username": obj.get("username"),
+ "first_name": obj.get("firstName"),
+ "last_name": obj.get("lastName"),
+ "email": obj.get("email"),
+ "password": obj.get("password"),
+ "phone": obj.get("phone"),
+ "user_status": obj.get("userStatus")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/with_nested_one_of.py
new file mode 100644
index 00000000000..0e80a8a9020
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/with_nested_one_of.py
@@ -0,0 +1,88 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, StrictInt
+from petstore_api.models.pig import Pig
+
+class WithNestedOneOf(BaseModel):
+ """NOTE: This class is auto generated by OpenAPI Generator.
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+ size: Optional[StrictInt] = None
+ nested_pig: Optional[Pig] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["size", "nested_pig"]
+
+ class Config:
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> WithNestedOneOf:
+ """Create an instance of WithNestedOneOf from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of nested_pig
+ if self.nested_pig:
+ _dict['nested_pig'] = self.nested_pig.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> WithNestedOneOf:
+ """Create an instance of WithNestedOneOf from a dict"""
+ if obj is None:
+ return None
+
+ if type(obj) is not dict:
+ return WithNestedOneOf.parse_obj(obj)
+
+ _obj = WithNestedOneOf.parse_obj({
+ "size": obj.get("size"),
+ "nested_pig": Pig.from_dict(obj.get("nested_pig")) if obj.get("nested_pig") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/rest.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/rest.py
new file mode 100755
index 00000000000..707cbc01288
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/rest.py
@@ -0,0 +1,296 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import io
+import json
+import logging
+import re
+import ssl
+
+from urllib.parse import urlencode, quote_plus
+import urllib3
+
+from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
+
+
+logger = logging.getLogger(__name__)
+
+
+class RESTResponse(io.IOBase):
+
+ def __init__(self, resp):
+ self.urllib3_response = resp
+ self.status = resp.status
+ self.reason = resp.reason
+ self.data = resp.data
+
+ def getheaders(self):
+ """Returns a dictionary of the response headers."""
+ return self.urllib3_response.getheaders()
+
+ def getheader(self, name, default=None):
+ """Returns a given response header."""
+ return self.urllib3_response.getheader(name, default)
+
+
+class RESTClientObject(object):
+
+ def __init__(self, configuration, pools_size=4, maxsize=None):
+ # urllib3.PoolManager will pass all kw parameters to connectionpool
+ # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501
+ # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501
+ # maxsize is the number of requests to host that are allowed in parallel # noqa: E501
+ # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501
+
+ # cert_reqs
+ if configuration.verify_ssl:
+ cert_reqs = ssl.CERT_REQUIRED
+ else:
+ cert_reqs = ssl.CERT_NONE
+
+ addition_pool_args = {}
+ if configuration.assert_hostname is not None:
+ addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
+
+ if configuration.retries is not None:
+ addition_pool_args['retries'] = configuration.retries
+
+ if configuration.socket_options is not None:
+ addition_pool_args['socket_options'] = configuration.socket_options
+
+ if maxsize is None:
+ if configuration.connection_pool_maxsize is not None:
+ maxsize = configuration.connection_pool_maxsize
+ else:
+ maxsize = 4
+
+ # https pool manager
+ if configuration.proxy:
+ self.pool_manager = urllib3.ProxyManager(
+ num_pools=pools_size,
+ maxsize=maxsize,
+ cert_reqs=cert_reqs,
+ ca_certs=configuration.ssl_ca_cert,
+ cert_file=configuration.cert_file,
+ key_file=configuration.key_file,
+ proxy_url=configuration.proxy,
+ proxy_headers=configuration.proxy_headers,
+ **addition_pool_args
+ )
+ else:
+ self.pool_manager = urllib3.PoolManager(
+ num_pools=pools_size,
+ maxsize=maxsize,
+ cert_reqs=cert_reqs,
+ ca_certs=configuration.ssl_ca_cert,
+ cert_file=configuration.cert_file,
+ key_file=configuration.key_file,
+ **addition_pool_args
+ )
+
+ def request(self, method, url, query_params=None, headers=None,
+ body=None, post_params=None, _preload_content=True,
+ _request_timeout=None):
+ """Perform requests.
+
+ :param method: http request method
+ :param url: http request url
+ :param query_params: query parameters in the url
+ :param headers: http request headers
+ :param body: request json body, for `application/json`
+ :param post_params: request post parameters,
+ `application/x-www-form-urlencoded`
+ and `multipart/form-data`
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ """
+ method = method.upper()
+ assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
+ 'PATCH', 'OPTIONS']
+
+ if post_params and body:
+ raise ApiValueError(
+ "body parameter cannot be used with post_params parameter."
+ )
+
+ post_params = post_params or {}
+ headers = headers or {}
+ # url already contains the URL query string
+ # so reset query_params to empty dict
+ query_params = {}
+
+ timeout = None
+ if _request_timeout:
+ if isinstance(_request_timeout, (int,float)): # noqa: E501,F821
+ timeout = urllib3.Timeout(total=_request_timeout)
+ elif (isinstance(_request_timeout, tuple) and
+ len(_request_timeout) == 2):
+ timeout = urllib3.Timeout(
+ connect=_request_timeout[0], read=_request_timeout[1])
+
+ try:
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
+ if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
+
+ # no content type provided or payload is json
+ if not headers.get('Content-Type') or re.search('json', headers['Content-Type'], re.IGNORECASE):
+ request_body = None
+ if body is not None:
+ request_body = json.dumps(body)
+ r = self.pool_manager.request(
+ method, url,
+ body=request_body,
+ preload_content=_preload_content,
+ timeout=timeout,
+ headers=headers)
+ elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
+ r = self.pool_manager.request(
+ method, url,
+ fields=post_params,
+ encode_multipart=False,
+ preload_content=_preload_content,
+ timeout=timeout,
+ headers=headers)
+ elif headers['Content-Type'] == 'multipart/form-data':
+ # must del headers['Content-Type'], or the correct
+ # Content-Type which generated by urllib3 will be
+ # overwritten.
+ del headers['Content-Type']
+ r = self.pool_manager.request(
+ method, url,
+ fields=post_params,
+ encode_multipart=True,
+ preload_content=_preload_content,
+ timeout=timeout,
+ headers=headers)
+ # Pass a `string` parameter directly in the body to support
+ # other content types than Json when `body` argument is
+ # provided in serialized form
+ elif isinstance(body, str) or isinstance(body, bytes):
+ request_body = body
+ r = self.pool_manager.request(
+ method, url,
+ body=request_body,
+ preload_content=_preload_content,
+ timeout=timeout,
+ headers=headers)
+ else:
+ # Cannot generate the request from given parameters
+ msg = """Cannot prepare a request message for provided
+ arguments. Please check that your arguments match
+ declared content type."""
+ raise ApiException(status=0, reason=msg)
+ # For `GET`, `HEAD`
+ else:
+ r = self.pool_manager.request(method, url,
+ fields={},
+ preload_content=_preload_content,
+ timeout=timeout,
+ headers=headers)
+ except urllib3.exceptions.SSLError as e:
+ msg = "{0}\n{1}".format(type(e).__name__, str(e))
+ raise ApiException(status=0, reason=msg)
+
+ if _preload_content:
+ r = RESTResponse(r)
+
+ # log response body
+ logger.debug("response body: %s", r.data)
+
+ if not 200 <= r.status <= 299:
+ if r.status == 401:
+ raise UnauthorizedException(http_resp=r)
+
+ if r.status == 403:
+ raise ForbiddenException(http_resp=r)
+
+ if r.status == 404:
+ raise NotFoundException(http_resp=r)
+
+ if 500 <= r.status <= 599:
+ raise ServiceException(http_resp=r)
+
+ raise ApiException(http_resp=r)
+
+ return r
+
+ def get_request(self, url, headers=None, query_params=None, _preload_content=True,
+ _request_timeout=None):
+ return self.request("GET", url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params)
+
+ def head_request(self, url, headers=None, query_params=None, _preload_content=True,
+ _request_timeout=None):
+ return self.request("HEAD", url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params)
+
+ def options_request(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ return self.request("OPTIONS", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+
+ def delete_request(self, url, headers=None, query_params=None, body=None,
+ _preload_content=True, _request_timeout=None):
+ return self.request("DELETE", url,
+ headers=headers,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+
+ def post_request(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ return self.request("POST", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+
+ def put_request(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ return self.request("PUT", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+
+ def patch_request(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ return self.request("PATCH", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/signing.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/signing.py
new file mode 100644
index 00000000000..5060f6edbcd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/signing.py
@@ -0,0 +1,416 @@
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from base64 import b64encode
+from Crypto.IO import PEM, PKCS8
+from Crypto.Hash import SHA256, SHA512
+from Crypto.PublicKey import RSA, ECC
+from Crypto.Signature import PKCS1_v1_5, pss, DSS
+from email.utils import formatdate
+import json
+import os
+import re
+from time import time
+from urllib.parse import urlencode, urlparse
+
+# The constants below define a subset of HTTP headers that can be included in the
+# HTTP signature scheme. Additional headers may be included in the signature.
+
+# The '(request-target)' header is a calculated field that includes the HTTP verb,
+# the URL path and the URL query.
+HEADER_REQUEST_TARGET = '(request-target)'
+# The time when the HTTP signature was generated.
+HEADER_CREATED = '(created)'
+# The time when the HTTP signature expires. The API server should reject HTTP requests
+# that have expired.
+HEADER_EXPIRES = '(expires)'
+# The 'Host' header.
+HEADER_HOST = 'Host'
+# The 'Date' header.
+HEADER_DATE = 'Date'
+# When the 'Digest' header is included in the HTTP signature, the client automatically
+# computes the digest of the HTTP request body, per RFC 3230.
+HEADER_DIGEST = 'Digest'
+# The 'Authorization' header is automatically generated by the client. It includes
+# the list of signed headers and a base64-encoded signature.
+HEADER_AUTHORIZATION = 'Authorization'
+
+# The constants below define the cryptographic schemes for the HTTP signature scheme.
+SCHEME_HS2019 = 'hs2019'
+SCHEME_RSA_SHA256 = 'rsa-sha256'
+SCHEME_RSA_SHA512 = 'rsa-sha512'
+
+# The constants below define the signature algorithms that can be used for the HTTP
+# signature scheme.
+ALGORITHM_RSASSA_PSS = 'RSASSA-PSS'
+ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5'
+
+ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3'
+ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979'
+ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = {
+ ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979
+}
+
+# The cryptographic hash algorithm for the message signature.
+HASH_SHA256 = 'sha256'
+HASH_SHA512 = 'sha512'
+
+
+class HttpSigningConfiguration(object):
+ """The configuration parameters for the HTTP signature security scheme.
+ The HTTP signature security scheme is used to sign HTTP requests with a private key
+ which is in possession of the API client.
+ An 'Authorization' header is calculated by creating a hash of select headers,
+ and optionally the body of the HTTP request, then signing the hash value using
+ a private key. The 'Authorization' header is added to outbound HTTP requests.
+
+ NOTE: This class is auto generated by OpenAPI Generator
+
+ Ref: https://openapi-generator.tech
+ Do not edit the class manually.
+
+ :param key_id: A string value specifying the identifier of the cryptographic key,
+ when signing HTTP requests.
+ :param signing_scheme: A string value specifying the signature scheme, when
+ signing HTTP requests.
+ Supported value are hs2019, rsa-sha256, rsa-sha512.
+ Avoid using rsa-sha256, rsa-sha512 as they are deprecated. These values are
+ available for server-side applications that only support the older
+ HTTP signature algorithms.
+ :param private_key_path: A string value specifying the path of the file containing
+ a private key. The private key is used to sign HTTP requests.
+ :param private_key_passphrase: A string value specifying the passphrase to decrypt
+ the private key.
+ :param signed_headers: A list of strings. Each value is the name of a HTTP header
+ that must be included in the HTTP signature calculation.
+ The two special signature headers '(request-target)' and '(created)' SHOULD be
+ included in SignedHeaders.
+ The '(created)' header expresses when the signature was created.
+ The '(request-target)' header is a concatenation of the lowercased :method, an
+ ASCII space, and the :path pseudo-headers.
+ When signed_headers is not specified, the client defaults to a single value,
+ '(created)', in the list of HTTP headers.
+ When SignedHeaders contains the 'Digest' value, the client performs the
+ following operations:
+ 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2.
+ 2. Set the 'Digest' header in the request body.
+ 3. Include the 'Digest' header and value in the HTTP signature.
+ :param signing_algorithm: A string value specifying the signature algorithm, when
+ signing HTTP requests.
+ Supported values are:
+ 1. For RSA keys: RSASSA-PSS, RSASSA-PKCS1-v1_5.
+ 2. For ECDSA keys: fips-186-3, deterministic-rfc6979.
+ If None, the signing algorithm is inferred from the private key.
+ The default signing algorithm for RSA keys is RSASSA-PSS.
+ The default signing algorithm for ECDSA keys is fips-186-3.
+ :param hash_algorithm: The hash algorithm for the signature. Supported values are
+ sha256 and sha512.
+ If the signing_scheme is rsa-sha256, the hash algorithm must be set
+ to None or sha256.
+ If the signing_scheme is rsa-sha512, the hash algorithm must be set
+ to None or sha512.
+ :param signature_max_validity: The signature max validity, expressed as
+ a datetime.timedelta value. It must be a positive value.
+ """
+ def __init__(self, key_id, signing_scheme, private_key_path,
+ private_key_passphrase=None,
+ signed_headers=None,
+ signing_algorithm=None,
+ hash_algorithm=None,
+ signature_max_validity=None):
+ self.key_id = key_id
+ if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}:
+ raise Exception("Unsupported security scheme: {0}".format(signing_scheme))
+ self.signing_scheme = signing_scheme
+ if not os.path.exists(private_key_path):
+ raise Exception("Private key file does not exist")
+ self.private_key_path = private_key_path
+ self.private_key_passphrase = private_key_passphrase
+ self.signing_algorithm = signing_algorithm
+ self.hash_algorithm = hash_algorithm
+ if signing_scheme == SCHEME_RSA_SHA256:
+ if self.hash_algorithm is None:
+ self.hash_algorithm = HASH_SHA256
+ elif self.hash_algorithm != HASH_SHA256:
+ raise Exception("Hash algorithm must be sha256 when security scheme is %s" %
+ SCHEME_RSA_SHA256)
+ elif signing_scheme == SCHEME_RSA_SHA512:
+ if self.hash_algorithm is None:
+ self.hash_algorithm = HASH_SHA512
+ elif self.hash_algorithm != HASH_SHA512:
+ raise Exception("Hash algorithm must be sha512 when security scheme is %s" %
+ SCHEME_RSA_SHA512)
+ elif signing_scheme == SCHEME_HS2019:
+ if self.hash_algorithm is None:
+ self.hash_algorithm = HASH_SHA256
+ elif self.hash_algorithm not in {HASH_SHA256, HASH_SHA512}:
+ raise Exception("Invalid hash algorithm")
+ if signature_max_validity is not None and signature_max_validity.total_seconds() < 0:
+ raise Exception("The signature max validity must be a positive value")
+ self.signature_max_validity = signature_max_validity
+ # If the user has not provided any signed_headers, the default must be set to '(created)',
+ # as specified in the 'HTTP signature' standard.
+ if signed_headers is None or len(signed_headers) == 0:
+ signed_headers = [HEADER_CREATED]
+ if self.signature_max_validity is None and HEADER_EXPIRES in signed_headers:
+ raise Exception(
+ "Signature max validity must be set when "
+ "'(expires)' signature parameter is specified")
+ if len(signed_headers) != len(set(signed_headers)):
+ raise Exception("Cannot have duplicates in the signed_headers parameter")
+ if HEADER_AUTHORIZATION in signed_headers:
+ raise Exception("'Authorization' header cannot be included in signed headers")
+ self.signed_headers = signed_headers
+ self.private_key = None
+ """The private key used to sign HTTP requests.
+ Initialized when the PEM-encoded private key is loaded from a file.
+ """
+ self.host = None
+ """The host name, optionally followed by a colon and TCP port number.
+ """
+ self._load_private_key()
+
+ def get_http_signature_headers(self, resource_path, method, headers, body, query_params):
+ """Create a cryptographic message signature for the HTTP request and add the signed headers.
+
+ :param resource_path : A string representation of the HTTP request resource path.
+ :param method: A string representation of the HTTP request method, e.g. GET, POST.
+ :param headers: A dict containing the HTTP request headers.
+ :param body: The object representing the HTTP request body.
+ :param query_params: A string representing the HTTP request query parameters.
+ :return: A dict of HTTP headers that must be added to the outbound HTTP request.
+ """
+ if method is None:
+ raise Exception("HTTP method must be set")
+ if resource_path is None:
+ raise Exception("Resource path must be set")
+
+ signed_headers_list, request_headers_dict = self._get_signed_header_info(
+ resource_path, method, headers, body, query_params)
+
+ header_items = [
+ "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list]
+ string_to_sign = "\n".join(header_items)
+
+ digest, digest_prefix = self._get_message_digest(string_to_sign.encode())
+ b64_signed_msg = self._sign_digest(digest)
+
+ request_headers_dict[HEADER_AUTHORIZATION] = self._get_authorization_header(
+ signed_headers_list, b64_signed_msg)
+
+ return request_headers_dict
+
+ def get_public_key(self):
+ """Returns the public key object associated with the private key.
+ """
+ pubkey = None
+ if isinstance(self.private_key, RSA.RsaKey):
+ pubkey = self.private_key.publickey()
+ elif isinstance(self.private_key, ECC.EccKey):
+ pubkey = self.private_key.public_key()
+ return pubkey
+
+ def _load_private_key(self):
+ """Load the private key used to sign HTTP requests.
+ The private key is used to sign HTTP requests as defined in
+ https://datatracker.ietf.org/doc/draft-cavage-http-signatures/.
+ """
+ if self.private_key is not None:
+ return
+ with open(self.private_key_path, 'r') as f:
+ pem_data = f.read()
+ # Verify PEM Pre-Encapsulation Boundary
+ r = re.compile(r"\s*-----BEGIN (.*)-----\s+")
+ m = r.match(pem_data)
+ if not m:
+ raise ValueError("Not a valid PEM pre boundary")
+ pem_header = m.group(1)
+ if pem_header == 'RSA PRIVATE KEY':
+ self.private_key = RSA.importKey(pem_data, self.private_key_passphrase)
+ elif pem_header == 'EC PRIVATE KEY':
+ self.private_key = ECC.import_key(pem_data, self.private_key_passphrase)
+ elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}:
+ # Key is in PKCS8 format, which is capable of holding many different
+ # types of private keys, not just EC keys.
+ (key_binary, pem_header, is_encrypted) = \
+ PEM.decode(pem_data, self.private_key_passphrase)
+ (oid, privkey, params) = \
+ PKCS8.unwrap(key_binary, passphrase=self.private_key_passphrase)
+ if oid == '1.2.840.10045.2.1':
+ self.private_key = ECC.import_key(pem_data, self.private_key_passphrase)
+ else:
+ raise Exception("Unsupported key: {0}. OID: {1}".format(pem_header, oid))
+ else:
+ raise Exception("Unsupported key: {0}".format(pem_header))
+ # Validate the specified signature algorithm is compatible with the private key.
+ if self.signing_algorithm is not None:
+ supported_algs = None
+ if isinstance(self.private_key, RSA.RsaKey):
+ supported_algs = {ALGORITHM_RSASSA_PSS, ALGORITHM_RSASSA_PKCS1v15}
+ elif isinstance(self.private_key, ECC.EccKey):
+ supported_algs = ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS
+ if supported_algs is not None and self.signing_algorithm not in supported_algs:
+ raise Exception(
+ "Signing algorithm {0} is not compatible with private key".format(
+ self.signing_algorithm))
+
+ def _get_signed_header_info(self, resource_path, method, headers, body, query_params):
+ """Build the HTTP headers (name, value) that need to be included in
+ the HTTP signature scheme.
+
+ :param resource_path : A string representation of the HTTP request resource path.
+ :param method: A string representation of the HTTP request method, e.g. GET, POST.
+ :param headers: A dict containing the HTTP request headers.
+ :param body: The object (e.g. a dict) representing the HTTP request body.
+ :param query_params: A string representing the HTTP request query parameters.
+ :return: A tuple containing two dict objects:
+ The first dict contains the HTTP headers that are used to calculate
+ the HTTP signature.
+ The second dict contains the HTTP headers that must be added to
+ the outbound HTTP request.
+ """
+
+ if body is None:
+ body = ''
+ else:
+ body = body.to_json()
+
+ # Build the '(request-target)' HTTP signature parameter.
+ target_host = urlparse(self.host).netloc
+ target_path = urlparse(self.host).path
+ request_target = method.lower() + " " + target_path + resource_path
+ if query_params:
+ request_target += "?" + urlencode(query_params)
+
+ # Get UNIX time, e.g. seconds since epoch, not including leap seconds.
+ now = time()
+ # Format date per RFC 7231 section-7.1.1.2. An example is:
+ # Date: Wed, 21 Oct 2015 07:28:00 GMT
+ cdate = formatdate(timeval=now, localtime=False, usegmt=True)
+ # The '(created)' value MUST be a Unix timestamp integer value.
+ # Subsecond precision is not supported.
+ created = int(now)
+ if self.signature_max_validity is not None:
+ expires = now + self.signature_max_validity.total_seconds()
+
+ signed_headers_list = []
+ request_headers_dict = {}
+ for hdr_key in self.signed_headers:
+ hdr_key = hdr_key.lower()
+ if hdr_key == HEADER_REQUEST_TARGET:
+ value = request_target
+ elif hdr_key == HEADER_CREATED:
+ value = '{0}'.format(created)
+ elif hdr_key == HEADER_EXPIRES:
+ value = '{0}'.format(expires)
+ elif hdr_key == HEADER_DATE.lower():
+ value = cdate
+ request_headers_dict[HEADER_DATE] = '{0}'.format(cdate)
+ elif hdr_key == HEADER_DIGEST.lower():
+ request_body = body.encode()
+ body_digest, digest_prefix = self._get_message_digest(request_body)
+ b64_body_digest = b64encode(body_digest.digest())
+ value = digest_prefix + b64_body_digest.decode('ascii')
+ request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format(
+ digest_prefix, b64_body_digest.decode('ascii'))
+ elif hdr_key == HEADER_HOST.lower():
+ value = target_host
+ request_headers_dict[HEADER_HOST] = '{0}'.format(target_host)
+ else:
+ value = next((v for k, v in headers.items() if k.lower() == hdr_key), None)
+ if value is None:
+ raise Exception(
+ "Cannot sign HTTP request. "
+ "Request does not contain the '{0}' header".format(hdr_key))
+ signed_headers_list.append((hdr_key, value))
+
+ return signed_headers_list, request_headers_dict
+
+ def _get_message_digest(self, data):
+ """Calculates and returns a cryptographic digest of a specified HTTP request.
+
+ :param data: The string representation of the date to be hashed with a cryptographic hash.
+ :return: A tuple of (digest, prefix).
+ The digest is a hashing object that contains the cryptographic digest of
+ the HTTP request.
+ The prefix is a string that identifies the cryptographic hash. It is used
+ to generate the 'Digest' header as specified in RFC 3230.
+ """
+ if self.hash_algorithm == HASH_SHA512:
+ digest = SHA512.new()
+ prefix = 'SHA-512='
+ elif self.hash_algorithm == HASH_SHA256:
+ digest = SHA256.new()
+ prefix = 'SHA-256='
+ else:
+ raise Exception("Unsupported hash algorithm: {0}".format(self.hash_algorithm))
+ digest.update(data)
+ return digest, prefix
+
+ def _sign_digest(self, digest):
+ """Signs a message digest with a private key specified in the signing_info.
+
+ :param digest: A hashing object that contains the cryptographic digest of the HTTP request.
+ :return: A base-64 string representing the cryptographic signature of the input digest.
+ """
+ sig_alg = self.signing_algorithm
+ if isinstance(self.private_key, RSA.RsaKey):
+ if sig_alg is None or sig_alg == ALGORITHM_RSASSA_PSS:
+ # RSASSA-PSS in Section 8.1 of RFC8017.
+ signature = pss.new(self.private_key).sign(digest)
+ elif sig_alg == ALGORITHM_RSASSA_PKCS1v15:
+ # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017.
+ signature = PKCS1_v1_5.new(self.private_key).sign(digest)
+ else:
+ raise Exception("Unsupported signature algorithm: {0}".format(sig_alg))
+ elif isinstance(self.private_key, ECC.EccKey):
+ if sig_alg is None:
+ sig_alg = ALGORITHM_ECDSA_MODE_FIPS_186_3
+ if sig_alg in ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS:
+ # draft-ietf-httpbis-message-signatures-00 does not specify the ECDSA encoding.
+ # Issue: https://github.com/w3c-ccg/http-signatures/issues/107
+ signature = DSS.new(key=self.private_key, mode=sig_alg,
+ encoding='der').sign(digest)
+ else:
+ raise Exception("Unsupported signature algorithm: {0}".format(sig_alg))
+ else:
+ raise Exception("Unsupported private key: {0}".format(type(self.private_key)))
+ return b64encode(signature)
+
+ def _get_authorization_header(self, signed_headers, signed_msg):
+ """Calculates and returns the value of the 'Authorization' header when signing HTTP requests.
+
+ :param signed_headers : A list of tuples. Each value is the name of a HTTP header that
+ must be included in the HTTP signature calculation.
+ :param signed_msg: A base-64 encoded string representation of the signature.
+ :return: The string value of the 'Authorization' header, representing the signature
+ of the HTTP request.
+ """
+ created_ts = None
+ expires_ts = None
+ for k, v in signed_headers:
+ if k == HEADER_CREATED:
+ created_ts = v
+ elif k == HEADER_EXPIRES:
+ expires_ts = v
+ lower_keys = [k.lower() for k, v in signed_headers]
+ headers_value = " ".join(lower_keys)
+
+ auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\",".format(
+ self.key_id, self.signing_scheme)
+ if created_ts is not None:
+ auth_str = auth_str + "created={0},".format(created_ts)
+ if expires_ts is not None:
+ auth_str = auth_str + "expires={0},".format(expires_ts)
+ auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format(
+ headers_value, signed_msg.decode('ascii'))
+
+ return auth_str
diff --git a/samples/openapi3/client/petstore/python-nextgen/pom.xml b/samples/openapi3/client/petstore/python-nextgen/pom.xml
new file mode 100755
index 00000000000..c418fd8a4e4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/pom.xml
@@ -0,0 +1,46 @@
+
+ 4.0.0
+ org.openapitools
+ PythonNextgenPetstoreTests
+ pom
+ 1.0-SNAPSHOT
+ Python OpenAPI3 Petstore Client
+
+
+
+ maven-dependency-plugin
+
+
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 1.2.1
+
+
+ test
+ integration-test
+
+ exec
+
+
+ make
+
+ test-all
+
+
+
+
+
+
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/requirements.txt b/samples/openapi3/client/petstore/python-nextgen/requirements.txt
new file mode 100755
index 00000000000..b98ff3e6069
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/requirements.txt
@@ -0,0 +1,5 @@
+python_dateutil >= 2.5.3
+setuptools >= 21.0.0
+urllib3 >= 1.25.3
+pydantic >= 1.10.2
+aenum >= 3.1.11
diff --git a/samples/openapi3/client/petstore/python-nextgen/setup.cfg b/samples/openapi3/client/petstore/python-nextgen/setup.cfg
new file mode 100755
index 00000000000..11433ee875a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/setup.cfg
@@ -0,0 +1,2 @@
+[flake8]
+max-line-length=99
diff --git a/samples/openapi3/client/petstore/python-nextgen/setup.py b/samples/openapi3/client/petstore/python-nextgen/setup.py
new file mode 100755
index 00000000000..cfffce8e317
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/setup.py
@@ -0,0 +1,49 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from setuptools import setup, find_packages # noqa: H301
+
+# To install the library, run the following
+#
+# python setup.py install
+#
+# prerequisite: setuptools
+# http://pypi.python.org/pypi/setuptools
+NAME = "petstore-api"
+VERSION = "1.0.0"
+PYTHON_REQUIRES = ">=3.7"
+REQUIRES = [
+ "urllib3 >= 1.25.3",
+ "python-dateutil",
+ "pem>=19.3.0",
+ "pycryptodome>=3.9.0",
+ "pydantic",
+ "aenum"
+]
+
+setup(
+ name=NAME,
+ version=VERSION,
+ description="OpenAPI Petstore",
+ author="OpenAPI Generator community",
+ author_email="team@openapitools.org",
+ url="",
+ keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"],
+ install_requires=REQUIRES,
+ packages=find_packages(exclude=["test", "tests"]),
+ include_package_data=True,
+ license="Apache-2.0",
+ long_description_content_type='text/markdown',
+ long_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: \" \\ # noqa: E501
+ """
+)
diff --git a/samples/openapi3/client/petstore/python-nextgen/test-requirements.txt b/samples/openapi3/client/petstore/python-nextgen/test-requirements.txt
new file mode 100755
index 00000000000..8fc452fe6ed
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test-requirements.txt
@@ -0,0 +1,4 @@
+pytest~=7.1.3
+pytest-cov>=2.8.1
+pytest-randomly>=3.12.0
+pycryptodome>=3.9.0
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/__init__.py b/samples/openapi3/client/petstore/python-nextgen/test/__init__.py
new file mode 100755
index 00000000000..e69de29bb2d
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-nextgen/test/test_additional_properties_class.py
new file mode 100644
index 00000000000..4383ae1726b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_additional_properties_class.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestAdditionalPropertiesClass(unittest.TestCase):
+ """AdditionalPropertiesClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test AdditionalPropertiesClass
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501
+ if include_optional :
+ return AdditionalPropertiesClass(
+ map_property = {
+ 'key' : ''
+ },
+ map_of_map_property = {
+ 'key' : {
+ 'key' : ''
+ }
+ }
+ )
+ else :
+ return AdditionalPropertiesClass(
+ )
+
+ def testAdditionalPropertiesClass(self):
+ """Test AdditionalPropertiesClass"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-nextgen/test/test_all_of_with_single_ref.py
new file mode 100644
index 00000000000..ee761ef82d0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_all_of_with_single_ref.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestAllOfWithSingleRef(unittest.TestCase):
+ """AllOfWithSingleRef unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test AllOfWithSingleRef
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.all_of_with_single_ref.AllOfWithSingleRef() # noqa: E501
+ if include_optional :
+ return AllOfWithSingleRef(
+ username = '',
+ single_ref_type = None
+ )
+ else :
+ return AllOfWithSingleRef(
+ )
+
+ def testAllOfWithSingleRef(self):
+ """Test AllOfWithSingleRef"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_animal.py b/samples/openapi3/client/petstore/python-nextgen/test/test_animal.py
new file mode 100644
index 00000000000..d209151de67
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_animal.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.animal import Animal # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestAnimal(unittest.TestCase):
+ """Animal unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Animal
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.animal.Animal() # noqa: E501
+ if include_optional :
+ return Animal(
+ class_name = '',
+ color = 'red'
+ )
+ else :
+ return Animal(
+ class_name = '',
+ )
+
+ def testAnimal(self):
+ """Test Animal"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python-nextgen/test/test_another_fake_api.py
new file mode 100644
index 00000000000..d95798cfc5a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_another_fake_api.py
@@ -0,0 +1,40 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestAnotherFakeApi(unittest.TestCase):
+ """AnotherFakeApi unit test stubs"""
+
+ def setUp(self):
+ self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_call_123_test_special_tags(self):
+ """Test case for call_123_test_special_tags
+
+ To test special tags # noqa: E501
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_any_of_pig.py b/samples/openapi3/client/petstore/python-nextgen/test/test_any_of_pig.py
new file mode 100644
index 00000000000..f041e5f9d6f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_any_of_pig.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.any_of_pig import AnyOfPig # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestAnyOfPig(unittest.TestCase):
+ """AnyOfPig unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testAnyOfPig(self):
+ """Test AnyOfPig"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_api_response.py b/samples/openapi3/client/petstore/python-nextgen/test/test_api_response.py
new file mode 100644
index 00000000000..95efd33bce5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_api_response.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.api_response import ApiResponse # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestApiResponse(unittest.TestCase):
+ """ApiResponse unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ApiResponse
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.api_response.ApiResponse() # noqa: E501
+ if include_optional :
+ return ApiResponse(
+ code = 56,
+ type = '',
+ message = ''
+ )
+ else :
+ return ApiResponse(
+ )
+
+ def testApiResponse(self):
+ """Test ApiResponse"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-nextgen/test/test_array_of_array_of_number_only.py
new file mode 100644
index 00000000000..001b4e56573
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_array_of_array_of_number_only.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
+ """ArrayOfArrayOfNumberOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ArrayOfArrayOfNumberOnly
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501
+ if include_optional :
+ return ArrayOfArrayOfNumberOnly(
+ array_array_number = [
+ [
+ 1.337
+ ]
+ ]
+ )
+ else :
+ return ArrayOfArrayOfNumberOnly(
+ )
+
+ def testArrayOfArrayOfNumberOnly(self):
+ """Test ArrayOfArrayOfNumberOnly"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-nextgen/test/test_array_of_number_only.py
new file mode 100644
index 00000000000..a35703ae0da
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_array_of_number_only.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestArrayOfNumberOnly(unittest.TestCase):
+ """ArrayOfNumberOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ArrayOfNumberOnly
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501
+ if include_optional :
+ return ArrayOfNumberOnly(
+ array_number = [
+ 1.337
+ ]
+ )
+ else :
+ return ArrayOfNumberOnly(
+ )
+
+ def testArrayOfNumberOnly(self):
+ """Test ArrayOfNumberOnly"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_array_test.py b/samples/openapi3/client/petstore/python-nextgen/test/test_array_test.py
new file mode 100644
index 00000000000..8327e415adc
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_array_test.py
@@ -0,0 +1,65 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.array_test import ArrayTest # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestArrayTest(unittest.TestCase):
+ """ArrayTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ArrayTest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.array_test.ArrayTest() # noqa: E501
+ if include_optional :
+ return ArrayTest(
+ array_of_string = [
+ ''
+ ],
+ array_array_of_integer = [
+ [
+ 56
+ ]
+ ],
+ array_array_of_model = [
+ [
+ petstore_api.models.read_only_first.ReadOnlyFirst(
+ bar = '',
+ baz = '', )
+ ]
+ ]
+ )
+ else :
+ return ArrayTest(
+ )
+
+ def testArrayTest(self):
+ """Test ArrayTest"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_basque_pig.py b/samples/openapi3/client/petstore/python-nextgen/test/test_basque_pig.py
new file mode 100644
index 00000000000..26e2a845a95
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_basque_pig.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.basque_pig import BasquePig # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestBasquePig(unittest.TestCase):
+ """BasquePig unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test BasquePig
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.basque_pig.BasquePig() # noqa: E501
+ if include_optional :
+ return BasquePig(
+ class_name = '',
+ color = ''
+ )
+ else :
+ return BasquePig(
+ class_name = '',
+ color = '',
+ )
+
+ def testBasquePig(self):
+ """Test BasquePig"""
+ #inst_req_only = self.make_instance(include_optional=False)
+ #inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_capitalization.py b/samples/openapi3/client/petstore/python-nextgen/test/test_capitalization.py
new file mode 100644
index 00000000000..c7a9721dbc0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_capitalization.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.capitalization import Capitalization # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestCapitalization(unittest.TestCase):
+ """Capitalization unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Capitalization
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.capitalization.Capitalization() # noqa: E501
+ if include_optional :
+ return Capitalization(
+ small_camel = '',
+ capital_camel = '',
+ small_snake = '',
+ capital_snake = '',
+ sca_eth_flow_points = '',
+ att_name = ''
+ )
+ else :
+ return Capitalization(
+ )
+
+ def testCapitalization(self):
+ """Test Capitalization"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_cat.py b/samples/openapi3/client/petstore/python-nextgen/test/test_cat.py
new file mode 100644
index 00000000000..e04566b1aaf
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_cat.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.cat import Cat # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestCat(unittest.TestCase):
+ """Cat unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testCat(self):
+ """Test Cat"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_cat_all_of.py b/samples/openapi3/client/petstore/python-nextgen/test/test_cat_all_of.py
new file mode 100644
index 00000000000..4708bf8bba3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_cat_all_of.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.cat_all_of import CatAllOf # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestCatAllOf(unittest.TestCase):
+ """CatAllOf unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test CatAllOf
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.cat_all_of.CatAllOf() # noqa: E501
+ if include_optional :
+ return CatAllOf(
+ declawed = True
+ )
+ else :
+ return CatAllOf(
+ )
+
+ def testCatAllOf(self):
+ """Test CatAllOf"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_category.py b/samples/openapi3/client/petstore/python-nextgen/test/test_category.py
new file mode 100644
index 00000000000..14848fcebcd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_category.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.category import Category # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestCategory(unittest.TestCase):
+ """Category unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Category
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.category.Category() # noqa: E501
+ if include_optional :
+ return Category(
+ id = 56,
+ name = 'default-name'
+ )
+ else :
+ return Category(
+ name = 'default-name',
+ )
+
+ def testCategory(self):
+ """Test Category"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_class_model.py b/samples/openapi3/client/petstore/python-nextgen/test/test_class_model.py
new file mode 100644
index 00000000000..511843f2dcf
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_class_model.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.class_model import ClassModel # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestClassModel(unittest.TestCase):
+ """ClassModel unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ClassModel
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.class_model.ClassModel() # noqa: E501
+ if include_optional :
+ return ClassModel(
+ _class = ''
+ )
+ else :
+ return ClassModel(
+ )
+
+ def testClassModel(self):
+ """Test ClassModel"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_client.py b/samples/openapi3/client/petstore/python-nextgen/test/test_client.py
new file mode 100644
index 00000000000..9209bb2c3f0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_client.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.client import Client # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestClient(unittest.TestCase):
+ """Client unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Client
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.client.Client() # noqa: E501
+ if include_optional :
+ return Client(
+ client = ''
+ )
+ else :
+ return Client(
+ )
+
+ def testClient(self):
+ """Test Client"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_configuration.py b/samples/openapi3/client/petstore/python-nextgen/test/test_configuration.py
new file mode 100755
index 00000000000..d41ffa63ba8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_configuration.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ OpenAPI spec version: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api import Configuration # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestConfiguration(unittest.TestCase):
+ """Configuration unit test stubs"""
+
+ def setUp(self):
+ self.config= Configuration()
+
+ def tearDown(self):
+ pass
+
+ def test_configuration(self):
+ """Test configuration
+
+ Test host settings # noqa: E501
+ """
+ host_settings = self.config.get_host_settings()
+
+ self.assertEqual('http://{server}.swagger.io:{port}/v2', host_settings[0]['url'])
+ self.assertEqual('petstore', host_settings[0]['variables']['server']['default_value'])
+
+ self.assertEqual('https://localhost:8080/{version}', host_settings[1]['url'])
+ self.assertEqual('v2', host_settings[1]['variables']['version']['default_value'])
+
+ def test_get_host_from_settings(self):
+ """ Test get_host_from_settings
+
+ Test get URL from host settings
+ """
+ self.assertEqual("http://petstore.swagger.io:80/v2", self.config.get_host_from_settings(0))
+ self.assertEqual("http://petstore.swagger.io:8080/v2", self.config.get_host_from_settings(0, {'port': '8080'}))
+ self.assertEqual("http://dev-petstore.swagger.io:8080/v2", self.config.get_host_from_settings(0, {'server': 'dev-petstore', 'port': '8080'}))
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_danish_pig.py b/samples/openapi3/client/petstore/python-nextgen/test/test_danish_pig.py
new file mode 100644
index 00000000000..0d850ae94f4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_danish_pig.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.danish_pig import DanishPig # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestDanishPig(unittest.TestCase):
+ """DanishPig unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test DanishPig
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.danish_pig.DanishPig() # noqa: E501
+ if include_optional :
+ return DanishPig(
+ class_name = '',
+ size = 56
+ )
+ else :
+ return DanishPig(
+ class_name = '',
+ size = 56,
+ )
+
+ def testDanishPig(self):
+ """Test DanishPig"""
+ #inst_req_only = self.make_instance(include_optional=False)
+ #inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_default_api.py b/samples/openapi3/client/petstore/python-nextgen/test/test_default_api.py
new file mode 100644
index 00000000000..50e7c57bd0b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_default_api.py
@@ -0,0 +1,39 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.api.default_api import DefaultApi # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestDefaultApi(unittest.TestCase):
+ """DefaultApi unit test stubs"""
+
+ def setUp(self):
+ self.api = petstore_api.api.default_api.DefaultApi() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_foo_get(self):
+ """Test case for foo_get
+
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_deprecated_object.py b/samples/openapi3/client/petstore/python-nextgen/test/test_deprecated_object.py
new file mode 100644
index 00000000000..50257271cd7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_deprecated_object.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.deprecated_object import DeprecatedObject # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestDeprecatedObject(unittest.TestCase):
+ """DeprecatedObject unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test DeprecatedObject
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.deprecated_object.DeprecatedObject() # noqa: E501
+ if include_optional :
+ return DeprecatedObject(
+ name = ''
+ )
+ else :
+ return DeprecatedObject(
+ )
+
+ def testDeprecatedObject(self):
+ """Test DeprecatedObject"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_dog.py b/samples/openapi3/client/petstore/python-nextgen/test/test_dog.py
new file mode 100644
index 00000000000..af75161287e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_dog.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.dog import Dog # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestDog(unittest.TestCase):
+ """Dog unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testDog(self):
+ """Test Dog"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_dog_all_of.py b/samples/openapi3/client/petstore/python-nextgen/test/test_dog_all_of.py
new file mode 100644
index 00000000000..44a266577a4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_dog_all_of.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.dog_all_of import DogAllOf # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestDogAllOf(unittest.TestCase):
+ """DogAllOf unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test DogAllOf
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.dog_all_of.DogAllOf() # noqa: E501
+ if include_optional :
+ return DogAllOf(
+ breed = ''
+ )
+ else :
+ return DogAllOf(
+ )
+
+ def testDogAllOf(self):
+ """Test DogAllOf"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_dummy_model.py b/samples/openapi3/client/petstore/python-nextgen/test/test_dummy_model.py
new file mode 100644
index 00000000000..d6562c58bc2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_dummy_model.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.dummy_model import DummyModel # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestDummyModel(unittest.TestCase):
+ """DummyModel unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test DummyModel
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `DummyModel`
+ """
+ model = petstore_api.models.dummy_model.DummyModel() # noqa: E501
+ if include_optional :
+ return DummyModel(
+ category = '',
+ self_ref = petstore_api.models.self_reference_model.Self-Reference-Model(
+ size = 56,
+ nested = petstore_api.models.dummy_model.Dummy-Model(
+ category = '', ), )
+ )
+ else :
+ return DummyModel(
+ )
+ """
+
+ def testDummyModel(self):
+ """Test DummyModel"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python-nextgen/test/test_enum_arrays.py
new file mode 100644
index 00000000000..52cc98601bc
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_enum_arrays.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.enum_arrays import EnumArrays # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestEnumArrays(unittest.TestCase):
+ """EnumArrays unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test EnumArrays
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501
+ if include_optional :
+ return EnumArrays(
+ just_symbol = '>=',
+ array_enum = [
+ 'fish'
+ ]
+ )
+ else :
+ return EnumArrays(
+ )
+
+ def testEnumArrays(self):
+ """Test EnumArrays"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_enum_class.py b/samples/openapi3/client/petstore/python-nextgen/test/test_enum_class.py
new file mode 100644
index 00000000000..9d7a81272cd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_enum_class.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.enum_class import EnumClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestEnumClass(unittest.TestCase):
+ """EnumClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testEnumClass(self):
+ """Test EnumClass"""
+ # inst = EnumClass()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_enum_test.py b/samples/openapi3/client/petstore/python-nextgen/test/test_enum_test.py
new file mode 100644
index 00000000000..afb342ae934
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_enum_test.py
@@ -0,0 +1,59 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.enum_test import EnumTest # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestEnumTest(unittest.TestCase):
+ """EnumTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test EnumTest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.enum_test.EnumTest() # noqa: E501
+ if include_optional :
+ return EnumTest(
+ enum_string = 'UPPER',
+ enum_string_required = 'UPPER',
+ enum_integer = 1,
+ enum_number = 1.1,
+ outer_enum = 'placed',
+ outer_enum_integer = 2,
+ outer_enum_default_value = 'placed',
+ outer_enum_integer_default_value = 0
+ )
+ else :
+ return EnumTest(
+ enum_string_required = 'UPPER',
+ )
+
+ def testEnumTest(self):
+ """Test EnumTest"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_fake_api.py b/samples/openapi3/client/petstore/python-nextgen/test/test_fake_api.py
new file mode 100644
index 00000000000..cf074093f90
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_fake_api.py
@@ -0,0 +1,146 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+try:
+ from unittest.mock import patch
+except ImportError:
+ from mock import patch
+
+import petstore_api
+from petstore_api.api.fake_api import FakeApi # noqa: E501
+
+
+class TestFakeApi(unittest.TestCase):
+ """FakeApi unit test stubs"""
+
+ def setUp(self):
+ self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_fake_health_get(self):
+ """Test case for fake_health_get
+
+ Health check endpoint # noqa: E501
+ """
+ pass
+
+ def test_fake_http_signature_test(self):
+ """Test case for fake_http_signature_test
+
+ test http signature authentication # noqa: E501
+ """
+ pass
+
+ def test_fake_outer_boolean_serialize(self):
+ """Test case for fake_outer_boolean_serialize
+
+ """
+ pass
+
+ def test_fake_outer_composite_serialize(self):
+ """Test case for fake_outer_composite_serialize
+
+ """
+ pass
+
+ def test_fake_outer_number_serialize(self):
+ """Test case for fake_outer_number_serialize
+
+ """
+ pass
+
+ def test_fake_outer_string_serialize(self):
+ """Test case for fake_outer_string_serialize
+
+ """
+ pass
+
+ def test_test_body_with_file_schema(self):
+ """Test case for test_body_with_file_schema
+
+ """
+ pass
+
+ def test_test_body_with_query_params(self):
+ """Test case for test_body_with_query_params
+
+ """
+ pass
+
+ def test_test_client_model(self):
+ """Test case for test_client_model
+
+ To test \"client\" model # noqa: E501
+ """
+ pass
+
+ def test_test_endpoint_parameters(self):
+ """Test case for test_endpoint_parameters
+
+ Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
+ """
+ pass
+
+ def test_test_enum_parameters(self):
+ """Test case for test_enum_parameters
+
+ To test enum parameters # noqa: E501
+ """
+ pass
+
+ def test_test_group_parameters(self):
+ """Test case for test_group_parameters
+
+ Fake endpoint to test group parameters (optional) # noqa: E501
+ """
+ pass
+
+ def test_test_inline_additional_properties(self):
+ """Test case for test_inline_additional_properties
+
+ test inline additionalProperties # noqa: E501
+ """
+ pass
+
+ def test_test_json_form_data(self):
+ """Test case for test_json_form_data
+
+ test json serialization of form data # noqa: E501
+ """
+ pass
+
+ def test_test_query_parameter_collection_format(self):
+ """Test case for test_query_parameter_collection_format
+
+ """
+ pass
+
+ def test_headers_parameter(self):
+ """Test case for the _headers are passed by the user
+
+ To test any optional parameter # noqa: E501
+ """
+ api = petstore_api.api.PetApi()
+ with patch("petstore_api.api_client.ApiClient.call_api") as mock_method:
+ value_headers = {"Header1": "value1"}
+ api.find_pets_by_status(["available"], _headers=value_headers)
+ args, _ = mock_method.call_args
+ self.assertEqual(args, ('/pet/findByStatus', 'GET', {}, [('status', ['available'])], {'Accept': 'application/json', 'Header1': 'value1'})
+)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-nextgen/test/test_fake_classname_tags123_api.py
new file mode 100644
index 00000000000..f54e0d06644
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_fake_classname_tags123_api.py
@@ -0,0 +1,40 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestFakeClassnameTags123Api(unittest.TestCase):
+ """FakeClassnameTags123Api unit test stubs"""
+
+ def setUp(self):
+ self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_test_classname(self):
+ """Test case for test_classname
+
+ To test class name in snake case # noqa: E501
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-nextgen/test/test_fake_classname_tags_123_api.py
new file mode 100644
index 00000000000..f54e0d06644
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_fake_classname_tags_123_api.py
@@ -0,0 +1,40 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestFakeClassnameTags123Api(unittest.TestCase):
+ """FakeClassnameTags123Api unit test stubs"""
+
+ def setUp(self):
+ self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_test_classname(self):
+ """Test case for test_classname
+
+ To test class name in snake case # noqa: E501
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_file.py b/samples/openapi3/client/petstore/python-nextgen/test/test_file.py
new file mode 100644
index 00000000000..3c9b91972d9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_file.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.file import File # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFile(unittest.TestCase):
+ """File unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test File
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.file.File() # noqa: E501
+ if include_optional :
+ return File(
+ source_uri = ''
+ )
+ else :
+ return File(
+ )
+
+ def testFile(self):
+ """Test File"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-nextgen/test/test_file_schema_test_class.py
new file mode 100644
index 00000000000..2834ddc0541
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_file_schema_test_class.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFileSchemaTestClass(unittest.TestCase):
+ """FileSchemaTestClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test FileSchemaTestClass
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501
+ if include_optional :
+ return FileSchemaTestClass(
+ file = petstore_api.models.file.File(
+ source_uri = '', ),
+ files = [
+ petstore_api.models.file.File(
+ source_uri = '', )
+ ]
+ )
+ else :
+ return FileSchemaTestClass(
+ )
+
+ def testFileSchemaTestClass(self):
+ """Test FileSchemaTestClass"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_foo.py b/samples/openapi3/client/petstore/python-nextgen/test/test_foo.py
new file mode 100644
index 00000000000..f592b1c3701
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_foo.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.foo import Foo # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFoo(unittest.TestCase):
+ """Foo unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Foo
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.foo.Foo() # noqa: E501
+ if include_optional :
+ return Foo(
+ bar = 'bar'
+ )
+ else :
+ return Foo(
+ )
+
+ def testFoo(self):
+ """Test Foo"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_foo_get_default_response.py b/samples/openapi3/client/petstore/python-nextgen/test/test_foo_get_default_response.py
new file mode 100644
index 00000000000..d2cadc258d8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_foo_get_default_response.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.foo_get_default_response import FooGetDefaultResponse # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFooGetDefaultResponse(unittest.TestCase):
+ """FooGetDefaultResponse unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test FooGetDefaultResponse
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.foo_get_default_response.FooGetDefaultResponse() # noqa: E501
+ if include_optional :
+ return FooGetDefaultResponse(
+ string = petstore_api.models.foo.Foo(
+ bar = 'bar', )
+ )
+ else :
+ return FooGetDefaultResponse(
+ )
+
+ def testFooGetDefaultResponse(self):
+ """Test FooGetDefaultResponse"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_format_test.py b/samples/openapi3/client/petstore/python-nextgen/test/test_format_test.py
new file mode 100644
index 00000000000..6038ab41357
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_format_test.py
@@ -0,0 +1,71 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.format_test import FormatTest # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestFormatTest(unittest.TestCase):
+ """FormatTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test FormatTest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.format_test.FormatTest() # noqa: E501
+ if include_optional :
+ return FormatTest(
+ integer = 10,
+ int32 = 20,
+ int64 = 56,
+ number = 132.1,
+ float = 54.3,
+ double = 67.8,
+ decimal = 1,
+ string = 'a',
+ byte = bytes("someting", 'utf-8'),
+ binary = bytes(b'blah'),
+ date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
+ date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ uuid = '72f98069-206d-4f12-9f12-3d1e525a8e84',
+ password = '0123456789',
+ pattern_with_digits = '0480728880',
+ pattern_with_digits_and_delimiter = 'image_480'
+ )
+ else :
+ return FormatTest(
+ number = 122.1,
+ byte = bytes("someting", 'utf-8'),
+ date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
+ password = '0123456789',
+ )
+
+ def testFormatTest(self):
+ """Test FormatTest"""
+ inst_req_only = self.make_instance(include_optional=False)
+ # TODO
+ #inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-nextgen/test/test_has_only_read_only.py
new file mode 100644
index 00000000000..2a8d2df6a0f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_has_only_read_only.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestHasOnlyReadOnly(unittest.TestCase):
+ """HasOnlyReadOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test HasOnlyReadOnly
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501
+ if include_optional :
+ return HasOnlyReadOnly(
+ bar = '',
+ foo = ''
+ )
+ else :
+ return HasOnlyReadOnly(
+ )
+
+ def testHasOnlyReadOnly(self):
+ """Test HasOnlyReadOnly"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-nextgen/test/test_health_check_result.py
new file mode 100644
index 00000000000..21c52053ea2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_health_check_result.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.health_check_result import HealthCheckResult # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestHealthCheckResult(unittest.TestCase):
+ """HealthCheckResult unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test HealthCheckResult
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.health_check_result.HealthCheckResult() # noqa: E501
+ if include_optional :
+ return HealthCheckResult(
+ nullable_message = ''
+ )
+ else :
+ return HealthCheckResult(
+ )
+
+ def testHealthCheckResult(self):
+ """Test HealthCheckResult"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_list.py b/samples/openapi3/client/petstore/python-nextgen/test/test_list.py
new file mode 100644
index 00000000000..4c603a5e9b1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_list.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.list import List # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestList(unittest.TestCase):
+ """List unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test List
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.list.List() # noqa: E501
+ if include_optional :
+ return List(
+ _123_list = ''
+ )
+ else :
+ return List(
+ )
+
+ def testList(self):
+ """Test List"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_map_test.py b/samples/openapi3/client/petstore/python-nextgen/test/test_map_test.py
new file mode 100644
index 00000000000..5e11fed312a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_map_test.py
@@ -0,0 +1,65 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.map_test import MapTest # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestMapTest(unittest.TestCase):
+ """MapTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MapTest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.map_test.MapTest() # noqa: E501
+ if include_optional :
+ return MapTest(
+ map_map_of_string = {
+ 'key' : {
+ 'key' : ''
+ }
+ },
+ map_of_enum_string = {
+ 'UPPER' : 'UPPER'
+ },
+ direct_map = {
+ 'key' : True
+ },
+ indirect_map = {
+ 'key' : True
+ }
+ )
+ else :
+ return MapTest(
+ )
+
+ def testMapTest(self):
+ """Test MapTest"""
+ # TODO
+ #inst_req_only = self.make_instance(include_optional=False)
+ #inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-nextgen/test/test_mixed_properties_and_additional_properties_class.py
new file mode 100644
index 00000000000..d217b114365
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_mixed_properties_and_additional_properties_class.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
+ """MixedPropertiesAndAdditionalPropertiesClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MixedPropertiesAndAdditionalPropertiesClass
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
+ if include_optional :
+ return MixedPropertiesAndAdditionalPropertiesClass(
+ uuid = '',
+ date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ map = {
+ 'key' : petstore_api.models.animal.Animal(
+ class_name = '',
+ color = 'red', )
+ }
+ )
+ else :
+ return MixedPropertiesAndAdditionalPropertiesClass(
+ )
+
+ def testMixedPropertiesAndAdditionalPropertiesClass(self):
+ """Test MixedPropertiesAndAdditionalPropertiesClass"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_model200_response.py b/samples/openapi3/client/petstore/python-nextgen/test/test_model200_response.py
new file mode 100644
index 00000000000..f7e9677e007
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_model200_response.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.model200_response import Model200Response # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestModel200Response(unittest.TestCase):
+ """Model200Response unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Model200Response
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.model200_response.Model200Response() # noqa: E501
+ if include_optional :
+ return Model200Response(
+ name = 56,
+ _class = ''
+ )
+ else :
+ return Model200Response(
+ )
+
+ def testModel200Response(self):
+ """Test Model200Response"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_model_return.py b/samples/openapi3/client/petstore/python-nextgen/test/test_model_return.py
new file mode 100644
index 00000000000..b0f9d9c4f7f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_model_return.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.model_return import ModelReturn # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestModelReturn(unittest.TestCase):
+ """ModelReturn unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ModelReturn
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.model_return.ModelReturn() # noqa: E501
+ if include_optional :
+ return ModelReturn(
+ _return = 56
+ )
+ else :
+ return ModelReturn(
+ )
+
+ def testModelReturn(self):
+ """Test ModelReturn"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_name.py b/samples/openapi3/client/petstore/python-nextgen/test/test_name.py
new file mode 100644
index 00000000000..bbf11fd231e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_name.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.name import Name # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestName(unittest.TestCase):
+ """Name unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Name
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.name.Name() # noqa: E501
+ if include_optional :
+ return Name(
+ name = 56,
+ snake_case = 56,
+ _property = '',
+ _123_number = 56
+ )
+ else :
+ return Name(
+ name = 56,
+ )
+
+ def testName(self):
+ """Test Name"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-nextgen/test/test_nullable_class.py
new file mode 100644
index 00000000000..7aa59f46bbd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_nullable_class.py
@@ -0,0 +1,77 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.nullable_class import NullableClass # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestNullableClass(unittest.TestCase):
+ """NullableClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test NullableClass
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.nullable_class.NullableClass() # noqa: E501
+ if include_optional :
+ return NullableClass(
+ required_integer_prop = 56,
+ integer_prop = 56,
+ number_prop = 1.337,
+ boolean_prop = True,
+ string_prop = '',
+ date_prop = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
+ datetime_prop = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ array_nullable_prop = [
+ None
+ ],
+ array_and_items_nullable_prop = [
+ None
+ ],
+ array_items_nullable = [
+ None
+ ],
+ object_nullable_prop = {
+ 'key' : None
+ },
+ object_and_items_nullable_prop = {
+ 'key' : None
+ },
+ object_items_nullable = {
+ 'key' : None
+ }
+ )
+ else :
+ return NullableClass(
+ required_integer_prop = 56
+ )
+
+ def testNullableClass(self):
+ """Test NullableClass"""
+ # TODO
+ #inst_req_only = self.make_instance(include_optional=False)
+ #inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_number_only.py b/samples/openapi3/client/petstore/python-nextgen/test/test_number_only.py
new file mode 100644
index 00000000000..776946c3d77
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_number_only.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.number_only import NumberOnly # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestNumberOnly(unittest.TestCase):
+ """NumberOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test NumberOnly
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.number_only.NumberOnly() # noqa: E501
+ if include_optional :
+ return NumberOnly(
+ just_number = 1.337
+ )
+ else :
+ return NumberOnly(
+ )
+
+ def testNumberOnly(self):
+ """Test NumberOnly"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-nextgen/test/test_object_with_deprecated_fields.py
new file mode 100644
index 00000000000..e0cbf3e98a5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_object_with_deprecated_fields.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestObjectWithDeprecatedFields(unittest.TestCase):
+ """ObjectWithDeprecatedFields unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ObjectWithDeprecatedFields
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.object_with_deprecated_fields.ObjectWithDeprecatedFields() # noqa: E501
+ if include_optional :
+ return ObjectWithDeprecatedFields(
+ uuid = '',
+ id = 1.337,
+ deprecated_ref = petstore_api.models.deprecated_object.DeprecatedObject(
+ name = '', ),
+ bars = [
+ 'bar'
+ ]
+ )
+ else :
+ return ObjectWithDeprecatedFields(
+ )
+
+ def testObjectWithDeprecatedFields(self):
+ """Test ObjectWithDeprecatedFields"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_order.py b/samples/openapi3/client/petstore/python-nextgen/test/test_order.py
new file mode 100644
index 00000000000..d6ec36f83a0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_order.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.order import Order # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOrder(unittest.TestCase):
+ """Order unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Order
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.order.Order() # noqa: E501
+ if include_optional :
+ return Order(
+ id = 56,
+ pet_id = 56,
+ quantity = 56,
+ ship_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ status = 'placed',
+ complete = True
+ )
+ else :
+ return Order(
+ )
+
+ def testOrder(self):
+ """Test Order"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_outer_composite.py b/samples/openapi3/client/petstore/python-nextgen/test/test_outer_composite.py
new file mode 100644
index 00000000000..c6fd5884937
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_outer_composite.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.outer_composite import OuterComposite # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOuterComposite(unittest.TestCase):
+ """OuterComposite unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test OuterComposite
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501
+ if include_optional :
+ return OuterComposite(
+ my_number = 1.337,
+ my_string = '',
+ my_boolean = True
+ )
+ else :
+ return OuterComposite(
+ )
+
+ def testOuterComposite(self):
+ """Test OuterComposite"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_outer_enum.py b/samples/openapi3/client/petstore/python-nextgen/test/test_outer_enum.py
new file mode 100644
index 00000000000..aa195260019
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_outer_enum.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.outer_enum import OuterEnum # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOuterEnum(unittest.TestCase):
+ """OuterEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testOuterEnum(self):
+ """Test OuterEnum"""
+ inst = OuterEnum("placed")
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_outer_enum_default_value.py b/samples/openapi3/client/petstore/python-nextgen/test/test_outer_enum_default_value.py
new file mode 100644
index 00000000000..f8fba3bd79a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_outer_enum_default_value.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOuterEnumDefaultValue(unittest.TestCase):
+ """OuterEnumDefaultValue unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testOuterEnumDefaultValue(self):
+ """Test OuterEnumDefaultValue"""
+ # inst = OuterEnumDefaultValue()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_outer_enum_integer.py b/samples/openapi3/client/petstore/python-nextgen/test/test_outer_enum_integer.py
new file mode 100644
index 00000000000..ce1e47c61b1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_outer_enum_integer.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.outer_enum_integer import OuterEnumInteger # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOuterEnumInteger(unittest.TestCase):
+ """OuterEnumInteger unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testOuterEnumInteger(self):
+ """Test OuterEnumInteger"""
+ # inst = OuterEnumInteger()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-nextgen/test/test_outer_enum_integer_default_value.py
new file mode 100644
index 00000000000..f0b707fca77
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_outer_enum_integer_default_value.py
@@ -0,0 +1,50 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOuterEnumIntegerDefaultValue(unittest.TestCase):
+ """OuterEnumIntegerDefaultValue unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test OuterEnumIntegerDefaultValue
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.outer_enum_integer_default_value.OuterEnumIntegerDefaultValue() # noqa: E501
+ if include_optional :
+ return OuterEnumIntegerDefaultValue(
+ )
+ else :
+ return OuterEnumIntegerDefaultValue(
+ )
+
+ def testOuterEnumIntegerDefaultValue(self):
+ """Test OuterEnumIntegerDefaultValue"""
+ #inst_req_only = self.make_instance(include_optional=False)
+ #inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-nextgen/test/test_outer_object_with_enum_property.py
new file mode 100644
index 00000000000..35258d5d74a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_outer_object_with_enum_property.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestOuterObjectWithEnumProperty(unittest.TestCase):
+ """OuterObjectWithEnumProperty unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test OuterObjectWithEnumProperty
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.outer_object_with_enum_property.OuterObjectWithEnumProperty() # noqa: E501
+ if include_optional :
+ return OuterObjectWithEnumProperty(
+ value = 2
+ )
+ else :
+ return OuterObjectWithEnumProperty(
+ value = 2,
+ )
+
+ def testOuterObjectWithEnumProperty(self):
+ """Test OuterObjectWithEnumProperty"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_pet.py b/samples/openapi3/client/petstore/python-nextgen/test/test_pet.py
new file mode 100644
index 00000000000..6d3fd2f35b0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_pet.py
@@ -0,0 +1,68 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.pet import Pet # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestPet(unittest.TestCase):
+ """Pet unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Pet
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.pet.Pet() # noqa: E501
+ if include_optional :
+ return Pet(
+ id = 56,
+ category = petstore_api.models.category.Category(
+ id = 56,
+ name = 'default-name', ),
+ name = 'doggie',
+ photo_urls = [
+ ''
+ ],
+ tags = [
+ petstore_api.models.tag.Tag(
+ id = 56,
+ name = '', )
+ ],
+ status = 'available'
+ )
+ else :
+ return Pet(
+ name = 'doggie',
+ photo_urls = [
+ ''
+ ],
+ )
+
+ def testPet(self):
+ """Test Pet"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_pet_api.py b/samples/openapi3/client/petstore/python-nextgen/test/test_pet_api.py
new file mode 100644
index 00000000000..77665df879f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_pet_api.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.api.pet_api import PetApi # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestPetApi(unittest.TestCase):
+ """PetApi unit test stubs"""
+
+ def setUp(self):
+ self.api = petstore_api.api.pet_api.PetApi() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_add_pet(self):
+ """Test case for add_pet
+
+ Add a new pet to the store # noqa: E501
+ """
+ pass
+
+ def test_delete_pet(self):
+ """Test case for delete_pet
+
+ Deletes a pet # noqa: E501
+ """
+ pass
+
+ def test_find_pets_by_status(self):
+ """Test case for find_pets_by_status
+
+ Finds Pets by status # noqa: E501
+ """
+ pass
+
+ def test_find_pets_by_tags(self):
+ """Test case for find_pets_by_tags
+
+ Finds Pets by tags # noqa: E501
+ """
+ pass
+
+ def test_get_pet_by_id(self):
+ """Test case for get_pet_by_id
+
+ Find pet by ID # noqa: E501
+ """
+ pass
+
+ def test_update_pet(self):
+ """Test case for update_pet
+
+ Update an existing pet # noqa: E501
+ """
+ pass
+
+ def test_update_pet_with_form(self):
+ """Test case for update_pet_with_form
+
+ Updates a pet in the store with form data # noqa: E501
+ """
+ pass
+
+ def test_upload_file(self):
+ """Test case for upload_file
+
+ uploads an image # noqa: E501
+ """
+ pass
+
+ def test_upload_file_with_required_file(self):
+ """Test case for upload_file_with_required_file
+
+ uploads an image (required) # noqa: E501
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_pig.py b/samples/openapi3/client/petstore/python-nextgen/test/test_pig.py
new file mode 100644
index 00000000000..95e99f35a73
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_pig.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.pig import Pig # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestPig(unittest.TestCase):
+ """Pig unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testPig(self):
+ """Test Pig"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-nextgen/test/test_read_only_first.py
new file mode 100644
index 00000000000..310e4b1aebb
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_read_only_first.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestReadOnlyFirst(unittest.TestCase):
+ """ReadOnlyFirst unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ReadOnlyFirst
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501
+ if include_optional :
+ return ReadOnlyFirst(
+ bar = '',
+ baz = ''
+ )
+ else :
+ return ReadOnlyFirst(
+ )
+
+ def testReadOnlyFirst(self):
+ """Test ReadOnlyFirst"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_self_reference_model.py b/samples/openapi3/client/petstore/python-nextgen/test/test_self_reference_model.py
new file mode 100644
index 00000000000..b3dd7ada2b2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_self_reference_model.py
@@ -0,0 +1,60 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.self_reference_model import SelfReferenceModel # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestSelfReferenceModel(unittest.TestCase):
+ """SelfReferenceModel unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test SelfReferenceModel
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `SelfReferenceModel`
+ """
+ model = petstore_api.models.self_reference_model.SelfReferenceModel() # noqa: E501
+ if include_optional :
+ return SelfReferenceModel(
+ size = 56,
+ nested = petstore_api.models.dummy_model.Dummy-Model(
+ category = '',
+ self_ref = petstore_api.models.self_reference_model.Self-Reference-Model(
+ size = 56,
+ nested = petstore_api.models.dummy_model.Dummy-Model(
+ category = '', ), ), )
+ )
+ else :
+ return SelfReferenceModel(
+ )
+ """
+
+ def testSelfReferenceModel(self):
+ """Test SelfReferenceModel"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_single_ref_type.py b/samples/openapi3/client/petstore/python-nextgen/test/test_single_ref_type.py
new file mode 100644
index 00000000000..888a1a7b6da
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_single_ref_type.py
@@ -0,0 +1,50 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.single_ref_type import SingleRefType # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestSingleRefType(unittest.TestCase):
+ """SingleRefType unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test SingleRefType
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.single_ref_type.SingleRefType() # noqa: E501
+ if include_optional :
+ return SingleRefType(
+ )
+ else :
+ return SingleRefType(
+ )
+
+ def testSingleRefType(self):
+ """Test SingleRefType"""
+ #inst_req_only = self.make_instance(include_optional=False)
+ #inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-nextgen/test/test_special_model_name.py
new file mode 100644
index 00000000000..eb487cd42fc
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_special_model_name.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.special_model_name import SpecialModelName # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestSpecialModelName(unittest.TestCase):
+ """SpecialModelName unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test SpecialModelName
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501
+ if include_optional :
+ return SpecialModelName(
+ special_property_name = 56
+ )
+ else :
+ return SpecialModelName(
+ )
+
+ def testSpecialModelName(self):
+ """Test SpecialModelName"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_special_name.py b/samples/openapi3/client/petstore/python-nextgen/test/test_special_name.py
new file mode 100644
index 00000000000..1f4287871a8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_special_name.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.special_name import SpecialName # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestSpecialName(unittest.TestCase):
+ """SpecialName unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test SpecialName
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `SpecialName`
+ """
+ model = petstore_api.models.special_name.SpecialName() # noqa: E501
+ if include_optional :
+ return SpecialName(
+ var_property = 56,
+ var_async = petstore_api.models.category.Category(
+ id = 56,
+ name = 'default-name', ),
+ status = 'available'
+ )
+ else :
+ return SpecialName(
+ )
+ """
+
+ def testSpecialName(self):
+ """Test SpecialName"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_store_api.py b/samples/openapi3/client/petstore/python-nextgen/test/test_store_api.py
new file mode 100644
index 00000000000..81848d24a67
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_store_api.py
@@ -0,0 +1,61 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.api.store_api import StoreApi # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestStoreApi(unittest.TestCase):
+ """StoreApi unit test stubs"""
+
+ def setUp(self):
+ self.api = petstore_api.api.store_api.StoreApi() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_delete_order(self):
+ """Test case for delete_order
+
+ Delete purchase order by ID # noqa: E501
+ """
+ pass
+
+ def test_get_inventory(self):
+ """Test case for get_inventory
+
+ Returns pet inventories by status # noqa: E501
+ """
+ pass
+
+ def test_get_order_by_id(self):
+ """Test case for get_order_by_id
+
+ Find purchase order by ID # noqa: E501
+ """
+ pass
+
+ def test_place_order(self):
+ """Test case for place_order
+
+ Place an order for a pet # noqa: E501
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_tag.py b/samples/openapi3/client/petstore/python-nextgen/test/test_tag.py
new file mode 100644
index 00000000000..9680300032f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_tag.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.tag import Tag # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestTag(unittest.TestCase):
+ """Tag unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Tag
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.tag.Tag() # noqa: E501
+ if include_optional :
+ return Tag(
+ id = 56,
+ name = ''
+ )
+ else :
+ return Tag(
+ )
+
+ def testTag(self):
+ """Test Tag"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_user.py b/samples/openapi3/client/petstore/python-nextgen/test/test_user.py
new file mode 100644
index 00000000000..174c8e06be5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_user.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.user import User # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestUser(unittest.TestCase):
+ """User unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test User
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.user.User() # noqa: E501
+ if include_optional :
+ return User(
+ id = 56,
+ username = '',
+ first_name = '',
+ last_name = '',
+ email = '',
+ password = '',
+ phone = '',
+ user_status = 56
+ )
+ else :
+ return User(
+ )
+
+ def testUser(self):
+ """Test User"""
+ inst_req_only = self.make_instance(include_optional=False)
+ inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_user_api.py b/samples/openapi3/client/petstore/python-nextgen/test/test_user_api.py
new file mode 100644
index 00000000000..6df730fba2b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_user_api.py
@@ -0,0 +1,89 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+from petstore_api.api.user_api import UserApi # noqa: E501
+from petstore_api.rest import ApiException
+
+
+class TestUserApi(unittest.TestCase):
+ """UserApi unit test stubs"""
+
+ def setUp(self):
+ self.api = petstore_api.api.user_api.UserApi() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_create_user(self):
+ """Test case for create_user
+
+ Create user # noqa: E501
+ """
+ pass
+
+ def test_create_users_with_array_input(self):
+ """Test case for create_users_with_array_input
+
+ Creates list of users with given input array # noqa: E501
+ """
+ pass
+
+ def test_create_users_with_list_input(self):
+ """Test case for create_users_with_list_input
+
+ Creates list of users with given input array # noqa: E501
+ """
+ pass
+
+ def test_delete_user(self):
+ """Test case for delete_user
+
+ Delete user # noqa: E501
+ """
+ pass
+
+ def test_get_user_by_name(self):
+ """Test case for get_user_by_name
+
+ Get user by user name # noqa: E501
+ """
+ pass
+
+ def test_login_user(self):
+ """Test case for login_user
+
+ Logs user into the system # noqa: E501
+ """
+ pass
+
+ def test_logout_user(self):
+ """Test case for logout_user
+
+ Logs out current logged in user session # noqa: E501
+ """
+ pass
+
+ def test_update_user(self):
+ """Test case for update_user
+
+ Updated user # noqa: E501
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_with_nested_one_of.py b/samples/openapi3/client/petstore/python-nextgen/test/test_with_nested_one_of.py
new file mode 100644
index 00000000000..994004dd7ab
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test/test_with_nested_one_of.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ 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: \" \\ # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by: https://openapi-generator.tech
+"""
+
+
+from __future__ import absolute_import
+
+import unittest
+import datetime
+
+import petstore_api
+from petstore_api.models.with_nested_one_of import WithNestedOneOf # noqa: E501
+from petstore_api.rest import ApiException
+
+class TestWithNestedOneOf(unittest.TestCase):
+ """WithNestedOneOf unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test WithNestedOneOf
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # model = petstore_api.models.with_nested_one_of.WithNestedOneOf() # noqa: E501
+ if include_optional :
+ return WithNestedOneOf(
+ size = 56,
+ nested_pig = None
+ )
+ else :
+ return WithNestedOneOf(
+ )
+
+ def testWithNestedOneOf(self):
+ """Test WithNestedOneOf"""
+ #inst_req_only = self.make_instance(include_optional=False)
+ #inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/test_python3.sh b/samples/openapi3/client/petstore/python-nextgen/test_python3.sh
new file mode 100755
index 00000000000..f617f3adfa6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/test_python3.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+REQUIREMENTS_FILE=dev-requirements.txt
+REQUIREMENTS_OUT=dev-requirements.txt.log
+SETUP_OUT=*.egg-info
+VENV=venv
+DEACTIVE=false
+
+export LC_ALL=en_US.UTF-8
+export LANG=en_US.UTF-8
+
+### set virtualenv
+if [ -z "$VIRTUAL_ENV" ]; then
+ virtualenv $VENV --always-copy
+ source $VENV/bin/activate
+ DEACTIVE=true
+fi
+
+### install dependencies
+pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
+
+### run tests
+tox || exit 1
+
+### static analysis of code
+#flake8 --show-source petstore_api/
+
+### deactivate virtualenv
+#if [ $DEACTIVE == true ]; then
+# deactivate
+#fi
diff --git a/samples/openapi3/client/petstore/python-nextgen/testfiles/pix.gif b/samples/openapi3/client/petstore/python-nextgen/testfiles/pix.gif
new file mode 100644
index 00000000000..f191b280ce9
Binary files /dev/null and b/samples/openapi3/client/petstore/python-nextgen/testfiles/pix.gif differ
diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/__init__.py b/samples/openapi3/client/petstore/python-nextgen/tests/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_api_client.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_api_client.py
new file mode 100644
index 00000000000..27ef96481ac
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_api_client.py
@@ -0,0 +1,214 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ pip install nose (optional)
+$ cd OpenAPIetstore-python
+$ nosetests -v
+"""
+
+import os
+import time
+import atexit
+import weakref
+import unittest
+from dateutil.parser import parse
+
+import petstore_api
+import petstore_api.configuration
+
+HOST = 'http://petstore.swagger.io/v2'
+
+
+class ApiClientTests(unittest.TestCase):
+
+ def setUp(self):
+ self.api_client = petstore_api.ApiClient()
+
+ def test_configuration(self):
+ config = petstore_api.Configuration()
+
+ config.api_key['api_key'] = '123456'
+ config.api_key_prefix['api_key'] = 'PREFIX'
+ config.username = 'test_username'
+ config.password = 'test_password'
+
+ header_params = {'test1': 'value1'}
+ query_params = {'test2': 'value2'}
+ auth_settings = ['api_key', 'unknown']
+
+ client = petstore_api.ApiClient(config)
+
+ # test prefix
+ self.assertEqual('PREFIX', client.configuration.api_key_prefix['api_key'])
+
+ # update parameters based on auth setting
+ client.update_params_for_auth(header_params, query_params,
+ auth_settings,
+ None, None, None)
+
+ # test api key auth
+ self.assertEqual(header_params['test1'], 'value1')
+ self.assertEqual(header_params['api_key'], 'PREFIX 123456')
+ self.assertEqual(query_params['test2'], 'value2')
+
+ # test basic auth
+ self.assertEqual('test_username', client.configuration.username)
+ self.assertEqual('test_password', client.configuration.password)
+
+ def test_select_header_accept(self):
+ accepts = ['APPLICATION/JSON', 'APPLICATION/XML']
+ accept = self.api_client.select_header_accept(accepts)
+ self.assertEqual(accept, 'APPLICATION/JSON')
+
+ accepts = ['application/json', 'application/xml']
+ accept = self.api_client.select_header_accept(accepts)
+ self.assertEqual(accept, 'application/json')
+
+ accepts = ['application/xml', 'application/json']
+ accept = self.api_client.select_header_accept(accepts)
+ self.assertEqual(accept, 'application/json')
+
+ accepts = ['application/xml', 'application/json-patch+json']
+ accept = self.api_client.select_header_accept(accepts)
+ self.assertEqual(accept, 'application/json-patch+json')
+
+ accepts = ['application/xml', 'application/json; charset=utf-8']
+ accept = self.api_client.select_header_accept(accepts)
+ self.assertEqual(accept, 'application/json; charset=utf-8')
+
+ accepts = ['application/xml', 'application/json;format=flowed']
+ accept = self.api_client.select_header_accept(accepts)
+ self.assertEqual(accept, 'application/json;format=flowed')
+
+ accepts = ['text/plain', 'application/xml']
+ accept = self.api_client.select_header_accept(accepts)
+ self.assertEqual(accept, 'text/plain')
+
+ accepts = []
+ accept = self.api_client.select_header_accept(accepts)
+ self.assertEqual(accept, None)
+
+ def test_select_header_content_type(self):
+ content_types = ['APPLICATION/JSON', 'APPLICATION/XML']
+ content_type = self.api_client.select_header_content_type(content_types)
+ self.assertEqual(content_type, 'APPLICATION/JSON')
+
+ content_types = ['application/json', 'application/xml']
+ content_type = self.api_client.select_header_content_type(content_types)
+ self.assertEqual(content_type, 'application/json')
+
+ content_types = ['application/xml', 'application/json']
+ content_type = self.api_client.select_header_content_type(content_types)
+ self.assertEqual(content_type, 'application/json')
+
+ content_types = ['application/xml', 'application/json-patch+json']
+ content_type = self.api_client.select_header_content_type(content_types)
+ self.assertEqual(content_type, 'application/json-patch+json')
+
+ content_types = ['application/xml', 'application/json; charset=utf-8']
+ content_type = self.api_client.select_header_content_type(content_types)
+ self.assertEqual(content_type, 'application/json; charset=utf-8')
+
+ content_types = ['application/xml', 'application/json;format=flowed']
+ content_type = self.api_client.select_header_content_type(content_types)
+ self.assertEqual(content_type, 'application/json;format=flowed')
+
+ content_types = ['text/plain', 'application/xml']
+ content_type = self.api_client.select_header_content_type(content_types)
+ self.assertEqual(content_type, 'text/plain')
+
+ # no content type, default to None
+ content_types = []
+ content_type = self.api_client.select_header_content_type(content_types)
+ self.assertEqual(content_type, None)
+
+ def test_sanitize_for_serialization(self):
+ # None
+ data = None
+ result = self.api_client.sanitize_for_serialization(None)
+ self.assertEqual(result, data)
+
+ # str
+ data = "test string"
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, data)
+
+ # int
+ data = 1
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, data)
+
+ # bool
+ data = True
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, data)
+
+ # date
+ data = parse("1997-07-16").date() # date
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, "1997-07-16")
+
+ # datetime
+ data = parse("1997-07-16T19:20:30.45+01:00") # datetime
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, "1997-07-16T19:20:30.450000+01:00")
+
+ # list
+ data = [1]
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, data)
+
+ # dict
+ data = {"test key": "test value"}
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, data)
+
+ # model
+ pet_dict = {"id": 1, "name": "monkey",
+ "category": {"id": 1, "name": "test category"},
+ "tags": [{"id": 1, "name": "test tag1"},
+ {"id": 2, "name": "test tag2"}],
+ "status": "available",
+ "photoUrls": ["http://foo.bar.com/3",
+ "http://foo.bar.com/4"]}
+ pet = petstore_api.Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"])
+ pet.id = pet_dict["id"]
+ cate = petstore_api.Category(name="something")
+ cate.id = pet_dict["category"]["id"]
+ cate.name = pet_dict["category"]["name"]
+ pet.category = cate
+ tag1 = petstore_api.Tag()
+ tag1.id = pet_dict["tags"][0]["id"]
+ tag1.name = pet_dict["tags"][0]["name"]
+ tag2 = petstore_api.Tag()
+ tag2.id = pet_dict["tags"][1]["id"]
+ tag2.name = pet_dict["tags"][1]["name"]
+ pet.tags = [tag1, tag2]
+ pet.status = pet_dict["status"]
+
+ data = pet
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, pet_dict)
+
+ # list of models
+ list_of_pet_dict = [pet_dict]
+ data = [pet]
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, list_of_pet_dict)
+
+ def test_context_manager_closes_threadpool(self):
+ with petstore_api.ApiClient() as client:
+ self.assertIsNotNone(client.pool)
+ pool_ref = weakref.ref(client._pool)
+ self.assertIsNotNone(pool_ref())
+ self.assertIsNone(pool_ref())
+
+ def test_atexit_closes_threadpool(self):
+ client = petstore_api.ApiClient()
+ self.assertIsNotNone(client.pool)
+ self.assertIsNotNone(client._pool)
+ atexit._run_exitfuncs()
+ self.assertIsNone(client._pool)
diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_api_exception.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_api_exception.py
new file mode 100644
index 00000000000..d517910174c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_api_exception.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ pip install nose (optional)
+$ cd petstore_api-python
+$ nosetests -v
+"""
+
+import os
+import six
+import sys
+import unittest
+
+import petstore_api
+from petstore_api.rest import ApiException
+
+from .util import id_gen
+
+
+class ApiExceptionTests(unittest.TestCase):
+
+ def setUp(self):
+ self.api_client = petstore_api.ApiClient()
+ self.pet_api = petstore_api.PetApi(self.api_client)
+ self.setUpModels()
+
+ def setUpModels(self):
+ self.category = petstore_api.Category(name="dog")
+ self.category.id = id_gen()
+ self.category.name = "dog"
+ self.tag = petstore_api.Tag()
+ self.tag.id = id_gen()
+ self.tag.name = "blank"
+ self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
+ self.pet.id = id_gen()
+ self.pet.status = "sold"
+ self.pet.category = self.category
+ self.pet.tags = [self.tag]
+
+ def test_404_error(self):
+ self.pet_api.add_pet(self.pet)
+ self.pet_api.delete_pet(pet_id=self.pet.id)
+
+ with self.checkRaiseRegex(ApiException, "Pet not found"):
+ self.pet_api.get_pet_by_id(pet_id=self.pet.id)
+
+ try:
+ self.pet_api.get_pet_by_id(pet_id=self.pet.id)
+ except ApiException as e:
+ self.assertEqual(e.status, 404)
+ self.assertEqual(e.reason, "Not Found")
+ self.checkRegex(e.body, "Pet not found")
+
+ def test_500_error(self):
+ self.pet_api.add_pet(self.pet)
+
+ with self.checkRaiseRegex(ApiException, "Internal Server Error"):
+ self.pet_api.upload_file(
+ pet_id=self.pet.id,
+ additional_metadata="special",
+ file=None
+ )
+
+ try:
+ self.pet_api.upload_file(
+ pet_id=self.pet.id,
+ additional_metadata="special",
+ file=None
+ )
+ except ApiException as e:
+ self.assertEqual(e.status, 500)
+ self.assertEqual(e.reason, "Internal Server Error")
+ self.checkRegex(e.body, "Error 500 Internal Server Error")
+
+ def checkRaiseRegex(self, expected_exception, expected_regex):
+ return self.assertRaisesRegex(expected_exception, expected_regex)
+
+ def checkRegex(self, text, expected_regex):
+ return self.assertRegex(text, expected_regex)
diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_api_validation.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_api_validation.py
new file mode 100644
index 00000000000..b42e6e50179
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_api_validation.py
@@ -0,0 +1,79 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ pip install nose (optional)
+$ cd petstore_api-python
+$ nosetests -v
+"""
+
+import os
+import six
+import sys
+import unittest
+
+import petstore_api
+from petstore_api.rest import ApiException
+from pydantic import BaseModel, ValidationError
+
+from .util import id_gen
+
+
+class ApiExceptionTests(unittest.TestCase):
+
+ def setUp(self):
+ self.api_client = petstore_api.ApiClient()
+ self.pet_api = petstore_api.PetApi(self.api_client)
+ self.setUpModels()
+
+ def setUpModels(self):
+ self.category = petstore_api.Category(name="dog")
+ self.category.id = id_gen()
+ self.category.name = "dog"
+ self.tag = petstore_api.Tag()
+ self.tag.id = id_gen()
+ self.tag.name = "blank"
+ self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
+ self.pet.id = id_gen()
+ self.pet.status = "sold"
+ self.pet.category = self.category
+ self.pet.tags = [self.tag]
+
+ def test_set_param_validation(self):
+ try:
+ self.pet_api.find_pets_by_tags(["a", "a"])
+ except ValidationError as e:
+ self.assertTrue("the list has duplicated items" in str(e))
+
+ def test_required_param_validation(self):
+ try:
+ self.pet_api.get_pet_by_id()
+ except ValidationError as e:
+ self.assertEqual(str(e), "1 validation error for GetPetById\n"
+ "pet_id\n"
+ " field required (type=value_error.missing)")
+
+ def test_integer_validation(self):
+ try:
+ self.pet_api.get_pet_by_id("123")
+ except ValidationError as e:
+ self.assertEqual(str(e), "1 validation error for GetPetById\n"
+ "pet_id\n"
+ " value is not a valid integer (type=type_error.integer)")
+
+ def test_string_enum_validation(self):
+ try:
+ self.pet_api.find_pets_by_status(["Cat"])
+ except ValidationError as e:
+ self.assertEqual(str(e), "1 validation error for FindPetsByStatus\n"
+ "status -> 0\n"
+ " unexpected value; permitted: 'available', 'pending', 'sold' ("
+ "type=value_error.const; given=Cat; permitted=('available', 'pending', 'sold'))")
+
+ def checkRaiseRegex(self, expected_exception, expected_regex):
+ return self.assertRaisesRegex(expected_exception, expected_regex)
+
+ def checkRegex(self, text, expected_regex):
+ return self.assertRegex(text, expected_regex)
diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_configuration.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_configuration.py
new file mode 100644
index 00000000000..21ab0219e01
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_configuration.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ pip install nose (optional)
+$ cd petstore_api-python
+$ nosetests -v
+"""
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+
+
+class TestConfiguration(unittest.TestCase):
+ """Animal unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ # reset Configuration
+ petstore_api.Configuration.set_default(None)
+
+ def testConfiguration(self):
+ # check that different instances use different dictionaries
+ c1 = petstore_api.Configuration()
+ c2 = petstore_api.Configuration()
+ self.assertNotEqual(id(c1), id(c2))
+ self.assertNotEqual(id(c1.api_key), id(c2.api_key))
+ self.assertNotEqual(id(c1.api_key_prefix), id(c2.api_key_prefix))
+
+ def testDefaultConfiguration(self):
+ # prepare default configuration
+ c1 = petstore_api.Configuration(host="example.com")
+ c1.debug = True
+ petstore_api.Configuration.set_default(c1)
+
+ # get default configuration
+ c2 = petstore_api.Configuration.get_default_copy()
+ self.assertEqual(c2.host, "example.com")
+ self.assertTrue(c2.debug)
+
+ self.assertEqual(id(c1), id(c2))
+ self.assertEqual(id(c1.api_key), id(c2.api_key))
+ self.assertEqual(id(c1.api_key_prefix), id(c2.api_key_prefix))
+
+ def testApiClientDefaultConfiguration(self):
+ # ensure the default configuration is the same
+ p1 = petstore_api.PetApi()
+ p2 = petstore_api.PetApi()
+ self.assertEqual(id(p1.api_client.configuration), id(p2.api_client.configuration))
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_deserialization.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_deserialization.py
new file mode 100644
index 00000000000..213e7000f63
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_deserialization.py
@@ -0,0 +1,295 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ pip install nose (optional)
+$ cd OpenAPIPetstore-python
+$ nosetests -v
+"""
+from collections import namedtuple
+import json
+import os
+import time
+import unittest
+import datetime
+
+import pytest as pytest
+
+import petstore_api
+
+MockResponse = namedtuple('MockResponse', 'data')
+
+
+class DeserializationTests(unittest.TestCase):
+
+ def setUp(self):
+ self.api_client = petstore_api.ApiClient()
+ self.deserialize = self.api_client.deserialize
+
+ def test_enum_test(self):
+ """ deserialize Dict[str, EnumTest] """
+ data = {
+ 'enum_test': {
+ "enum_string": "UPPER",
+ "enum_string_required": "lower",
+ "enum_integer": 1,
+ "enum_number": 1.1,
+ "outerEnum": "placed"
+ }
+ }
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, 'Dict[str, EnumTest]')
+ self.assertTrue(isinstance(deserialized, dict))
+ self.assertTrue(isinstance(deserialized['enum_test'], petstore_api.EnumTest))
+ self.assertEqual(deserialized['enum_test'],
+ petstore_api.EnumTest(enum_string="UPPER",
+ enum_string_required="lower",
+ enum_integer=1,
+ enum_number=1.1,
+ outer_enum=petstore_api.OuterEnum.PLACED))
+
+ def test_deserialize_dict_str_pet(self):
+ """ deserialize Dict[str, Pet] """
+ data = {
+ 'pet': {
+ "id": 0,
+ "category": {
+ "id": 0,
+ "name": "string"
+ },
+ "name": "doggie",
+ "photoUrls": [
+ "string"
+ ],
+ "tags": [
+ {
+ "id": 0,
+ "name": "string"
+ }
+ ],
+ "status": "available"
+ }
+ }
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, 'Dict[str, Pet]')
+ self.assertTrue(isinstance(deserialized, dict))
+ self.assertTrue(isinstance(deserialized['pet'], petstore_api.Pet))
+
+ @pytest.mark.skip(reason="skipping for now as deserialization will be refactored")
+ def test_deserialize_dict_str_dog(self):
+ """ deserialize Dict[str, Animal], use discriminator"""
+ data = {
+ 'dog': {
+ "id": 0,
+ "className": "Dog",
+ "color": "white",
+ "bread": "Jack Russel Terrier"
+ }
+ }
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, 'Dict[str, Animal]')
+ self.assertTrue(isinstance(deserialized, dict))
+ self.assertTrue(isinstance(deserialized['dog'], petstore_api.Dog))
+
+ @pytest.mark.skip(reason="skipping for now as deserialization will be refactored")
+ def test_deserialize_dict_str_int(self):
+ """ deserialize Dict[str, int] """
+ data = {
+ 'integer': 1
+ }
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, 'Dict[str, int]')
+ self.assertTrue(isinstance(deserialized, dict))
+ self.assertTrue(isinstance(deserialized['integer'], int))
+
+ def test_deserialize_str(self):
+ """ deserialize str """
+ data = "test str"
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, "str")
+ self.assertTrue(isinstance(deserialized, str))
+
+ def test_deserialize_date(self):
+ """ deserialize date """
+ data = "1997-07-16"
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, "date")
+ self.assertTrue(isinstance(deserialized, datetime.date))
+
+ def test_deserialize_datetime(self):
+ """ deserialize datetime """
+ data = "1997-07-16T19:20:30.45+01:00"
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, "datetime")
+ self.assertTrue(isinstance(deserialized, datetime.datetime))
+
+ def test_deserialize_pet(self):
+ """ deserialize pet """
+ data = {
+ "id": 0,
+ "category": {
+ "id": 0,
+ "name": "string"
+ },
+ "name": "doggie",
+ "photoUrls": [
+ "string"
+ ],
+ "tags": [
+ {
+ "id": 0,
+ "name": "string"
+ }
+ ],
+ "status": "available"
+ }
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, "Pet")
+ self.assertTrue(isinstance(deserialized, petstore_api.Pet))
+ self.assertEqual(deserialized.id, 0)
+ self.assertEqual(deserialized.name, "doggie")
+ self.assertTrue(isinstance(deserialized.category, petstore_api.Category))
+ self.assertEqual(deserialized.category.name, "string")
+ self.assertTrue(isinstance(deserialized.tags, list))
+ self.assertEqual(deserialized.tags[0].name, "string")
+
+ def test_deserialize_list_of_pet(self):
+ """ deserialize list[Pet] """
+ data = [
+ {
+ "id": 0,
+ "category": {
+ "id": 0,
+ "name": "string"
+ },
+ "name": "doggie0",
+ "photoUrls": [
+ "string"
+ ],
+ "tags": [
+ {
+ "id": 0,
+ "name": "string"
+ }
+ ],
+ "status": "available"
+ },
+ {
+ "id": 1,
+ "category": {
+ "id": 0,
+ "name": "string"
+ },
+ "name": "doggie1",
+ "photoUrls": [
+ "string"
+ ],
+ "tags": [
+ {
+ "id": 0,
+ "name": "string"
+ }
+ ],
+ "status": "available"
+ }]
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, "List[Pet]")
+ self.assertTrue(isinstance(deserialized, list))
+ self.assertTrue(isinstance(deserialized[0], petstore_api.Pet))
+ self.assertEqual(deserialized[0].id, 0)
+ self.assertEqual(deserialized[1].id, 1)
+ self.assertEqual(deserialized[0].name, "doggie0")
+ self.assertEqual(deserialized[1].name, "doggie1")
+
+ def test_deserialize_nested_dict(self):
+ """ deserialize Dict[str, Dict[str, int]] """
+ data = {
+ "foo": {
+ "bar": 1
+ }
+ }
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, "Dict[str, Dict[str, int]]")
+ self.assertTrue(isinstance(deserialized, dict))
+ self.assertTrue(isinstance(deserialized["foo"], dict))
+ self.assertTrue(isinstance(deserialized["foo"]["bar"], int))
+
+ def test_deserialize_nested_list(self):
+ """ deserialize list[list[str]] """
+ data = [["foo"]]
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, "List[List[str]]")
+ self.assertTrue(isinstance(deserialized, list))
+ self.assertTrue(isinstance(deserialized[0], list))
+ self.assertTrue(isinstance(deserialized[0][0], str))
+
+ def test_deserialize_none(self):
+ """ deserialize None """
+ response = MockResponse(data=json.dumps(None))
+
+ deserialized = self.deserialize(response, "datetime")
+ self.assertIsNone(deserialized)
+
+ def test_deserialize_pig(self):
+ """ deserialize pig (oneOf) """
+ data = {
+ "className": "BasqueBig",
+ "color": "white"
+ }
+
+ response = MockResponse(data=json.dumps(data))
+ deserialized = self.deserialize(response, "Pig")
+ self.assertTrue(isinstance(deserialized.actual_instance,
+ petstore_api.BasquePig))
+ self.assertEqual(deserialized.actual_instance.class_name, "BasqueBig")
+ self.assertEqual(deserialized.actual_instance.color, "white")
+
+ def test_deserialize_animal(self):
+ """ deserialize animal with discriminator mapping """
+ data = {
+ "declawed": True,
+ "className": "Cat2222" # incorrect class name
+ }
+
+ response = MockResponse(data=json.dumps(data))
+
+ with pytest.raises(ValueError) as ex:
+ deserialized = self.deserialize(response, "Animal")
+ assert str(
+ ex.value) == 'Animal failed to lookup discriminator value from {"declawed": true, "className": ' \
+ '"Cat2222"}. Discriminator property name: className, mapping: {"Cat": "Cat", "Dog": "Dog"}'
+
+ data = {
+ "declawed": True,
+ "className": "Cat" # correct class name
+ }
+
+ response = MockResponse(data=json.dumps(data))
+
+ deserialized = self.deserialize(response, "Animal")
+ self.assertTrue(isinstance(deserialized, petstore_api.Cat))
+ self.assertEqual(deserialized.class_name, "Cat")
+ self.assertEqual(deserialized.declawed, True)
+ self.assertEqual(deserialized.to_json(), '{"className": "Cat", "color": "red", "declawed": true}')
+
+ # test from json
+ json_str = '{"className": "Cat", "color": "red", "declawed": true}'
+
+ deserialized = petstore_api.Animal.from_json(json_str)
+ self.assertTrue(isinstance(deserialized, petstore_api.Cat))
+ self.assertEqual(deserialized.class_name, "Cat")
+ self.assertEqual(deserialized.declawed, True)
+ self.assertEqual(deserialized.to_json(), '{"className": "Cat", "color": "red", "declawed": true}')
diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_http_signature.py
new file mode 100644
index 00000000000..2784d3ac1d0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_http_signature.py
@@ -0,0 +1,521 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ docker pull swaggerapi/petstore
+$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
+$ cd petstore_api-python
+$ pytest
+"""
+
+from collections import namedtuple
+from datetime import datetime, timedelta
+import base64
+import json
+import os
+import re
+import shutil
+import unittest
+from urllib.parse import urlencode, urlparse
+
+from Crypto.Hash import SHA256, SHA512
+from Crypto.PublicKey import ECC, RSA
+from Crypto.Signature import pkcs1_15, pss, DSS
+
+import petstore_api
+#from petstore_api.models import Category, Tag, Pet
+from petstore_api.api.pet_api import PetApi
+from petstore_api import Configuration, signing
+from petstore_api.rest import (
+ RESTClientObject,
+ RESTResponse
+)
+
+from petstore_api.exceptions import (
+ ApiException,
+ ApiValueError,
+ ApiTypeError,
+)
+
+from .util import id_gen
+
+import urllib3
+
+from unittest.mock import patch
+
+HOST = 'http://localhost/v2'
+
+# This test RSA private key below is published in Appendix C 'Test Values' of
+# https://www.ietf.org/id/draft-cavage-http-signatures-12.txt
+RSA_TEST_PRIVATE_KEY = """-----BEGIN RSA PRIVATE KEY-----
+MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF
+NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F
+UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB
+AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA
+QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK
+kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg
+f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u
+412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc
+mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7
+kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA
+gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW
+G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI
+7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA==
+-----END RSA PRIVATE KEY-----"""
+
+
+class TimeoutWithEqual(urllib3.Timeout):
+ def __init__(self, *arg, **kwargs):
+ super(TimeoutWithEqual, self).__init__(*arg, **kwargs)
+
+ def __eq__(self, other):
+ return self._read == other._read and self._connect == other._connect and self.total == other.total
+
+class MockPoolManager(object):
+ def __init__(self, tc):
+ self._tc = tc
+ self._reqs = []
+
+ def expect_request(self, *args, **kwargs):
+ self._reqs.append((args, kwargs))
+
+ def set_signing_config(self, signing_cfg):
+ self.signing_cfg = signing_cfg
+ self._tc.assertIsNotNone(self.signing_cfg)
+ self.pubkey = self.signing_cfg.get_public_key()
+ self._tc.assertIsNotNone(self.pubkey)
+
+ def request(self, *actual_request_target, **actual_request_headers_and_body):
+ self._tc.assertTrue(len(self._reqs) > 0)
+ expected_results = self._reqs.pop(0)
+ self._tc.maxDiff = None
+ expected_request_target = expected_results[0] # The expected HTTP method and URL path.
+ expected_request_headers_and_body = expected_results[1] # dict that contains the expected body, headers
+ self._tc.assertEqual(expected_request_target, actual_request_target)
+ # actual_request_headers_and_body is a dict that contains the actual body, headers
+ for k, expected in expected_request_headers_and_body.items():
+ self._tc.assertIn(k, actual_request_headers_and_body)
+ if k == 'body':
+ actual_body = actual_request_headers_and_body[k]
+ self._tc.assertEqual(expected, actual_body)
+ elif k == 'headers':
+ actual_headers = actual_request_headers_and_body[k]
+ for expected_header_name, expected_header_value in expected.items():
+ # Validate the generated request contains the expected header.
+ self._tc.assertIn(expected_header_name, actual_headers)
+ actual_header_value = actual_headers[expected_header_name]
+ # Compare the actual value of the header against the expected value.
+ pattern = re.compile(expected_header_value)
+ m = pattern.match(actual_header_value)
+ self._tc.assertTrue(m, msg="Expected:\n{0}\nActual:\n{1}".format(
+ expected_header_value,actual_header_value))
+ if expected_header_name == 'Authorization':
+ self._validate_authorization_header(
+ expected_request_target, actual_headers, actual_header_value)
+ elif k == 'timeout':
+ self._tc.assertEqual(expected, actual_request_headers_and_body[k])
+ return urllib3.HTTPResponse(status=200, body=b'test')
+
+ def _validate_authorization_header(self, request_target, actual_headers, authorization_header):
+ """Validate the signature.
+ """
+ # Extract (created)
+ r1 = re.compile(r'created=([0-9]+)')
+ m1 = r1.search(authorization_header)
+ self._tc.assertIsNotNone(m1)
+ created = m1.group(1)
+
+ # Extract list of signed headers
+ r1 = re.compile(r'headers="([^"]+)"')
+ m1 = r1.search(authorization_header)
+ self._tc.assertIsNotNone(m1)
+ headers = m1.group(1).split(' ')
+ signed_headers_list = []
+ for h in headers:
+ if h == '(created)':
+ signed_headers_list.append((h, created))
+ elif h == '(request-target)':
+ url = request_target[1]
+ target_path = urlparse(url).path
+ signed_headers_list.append((h, "{0} {1}".format(request_target[0].lower(), target_path)))
+ else:
+ value = next((v for k, v in actual_headers.items() if k.lower() == h), None)
+ self._tc.assertIsNotNone(value)
+ signed_headers_list.append((h, value))
+ header_items = [
+ "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list]
+ string_to_sign = "\n".join(header_items)
+ digest = None
+ if self.signing_cfg.hash_algorithm == signing.HASH_SHA512:
+ digest = SHA512.new()
+ elif self.signing_cfg.hash_algorithm == signing.HASH_SHA256:
+ digest = SHA256.new()
+ else:
+ self._tc.fail("Unsupported hash algorithm: {0}".format(self.signing_cfg.hash_algorithm))
+ digest.update(string_to_sign.encode())
+ b64_body_digest = base64.b64encode(digest.digest()).decode()
+
+ # Extract the signature
+ r2 = re.compile(r'signature="([^"]+)"')
+ m2 = r2.search(authorization_header)
+ self._tc.assertIsNotNone(m2)
+ b64_signature = m2.group(1)
+ signature = base64.b64decode(b64_signature)
+ # Build the message
+ signing_alg = self.signing_cfg.signing_algorithm
+ if signing_alg is None:
+ # Determine default
+ if isinstance(self.pubkey, RSA.RsaKey):
+ signing_alg = signing.ALGORITHM_RSASSA_PSS
+ elif isinstance(self.pubkey, ECC.EccKey):
+ signing_alg = signing.ALGORITHM_ECDSA_MODE_FIPS_186_3
+ else:
+ self._tc.fail("Unsupported key: {0}".format(type(self.pubkey)))
+
+ if signing_alg == signing.ALGORITHM_RSASSA_PKCS1v15:
+ pkcs1_15.new(self.pubkey).verify(digest, signature)
+ elif signing_alg == signing.ALGORITHM_RSASSA_PSS:
+ pss.new(self.pubkey).verify(digest, signature)
+ elif signing_alg == signing.ALGORITHM_ECDSA_MODE_FIPS_186_3:
+ verifier = DSS.new(key=self.pubkey, mode=signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ encoding='der')
+ verifier.verify(digest, signature)
+ elif signing_alg == signing.ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979:
+ verifier = DSS.new(key=self.pubkey, mode=signing.ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979,
+ encoding='der')
+ verifier.verify(digest, signature)
+ else:
+ self._tc.fail("Unsupported signing algorithm: {0}".format(signing_alg))
+
+class PetApiTests(unittest.TestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ cls.setUpModels()
+ cls.setUpFiles()
+
+ @classmethod
+ def tearDownClass(cls):
+ file_paths = [
+ cls.rsa_key_path,
+ cls.rsa4096_key_path,
+ cls.ec_p521_key_path,
+ ]
+ for file_path in file_paths:
+ os.unlink(file_path)
+
+ @classmethod
+ def setUpModels(cls):
+ cls.category = petstore_api.Category(name="dog")
+ cls.category.id = id_gen()
+ cls.tag = petstore_api.Tag()
+ cls.tag.id = id_gen()
+ cls.tag.name = "python-pet-tag"
+ cls.pet = petstore_api.Pet(
+ name="hello kity",
+ photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]
+ )
+ cls.pet.id = id_gen()
+ cls.pet.status = "sold"
+ cls.pet.category = cls.category
+ cls.pet.tags = [cls.tag]
+
+ @classmethod
+ def setUpFiles(cls):
+ cls.test_file_dir = os.path.join(
+ os.path.dirname(__file__), "..", "testfiles")
+ cls.test_file_dir = os.path.realpath(cls.test_file_dir)
+ if not os.path.exists(cls.test_file_dir):
+ os.mkdir(cls.test_file_dir)
+
+ cls.private_key_passphrase = 'test-passphrase'
+ cls.rsa_key_path = os.path.join(cls.test_file_dir, 'rsa.pem')
+ cls.rsa4096_key_path = os.path.join(cls.test_file_dir, 'rsa4096.pem')
+ cls.ec_p521_key_path = os.path.join(cls.test_file_dir, 'ecP521.pem')
+
+ if not os.path.exists(cls.rsa_key_path):
+ with open(cls.rsa_key_path, 'w') as f:
+ f.write(RSA_TEST_PRIVATE_KEY)
+
+ if not os.path.exists(cls.rsa4096_key_path):
+ key = RSA.generate(4096)
+ private_key = key.export_key(
+ passphrase=cls.private_key_passphrase,
+ protection='PEM'
+ )
+ with open(cls.rsa4096_key_path, "wb") as f:
+ f.write(private_key)
+
+ if not os.path.exists(cls.ec_p521_key_path):
+ key = ECC.generate(curve='P-521')
+ private_key = key.export_key(
+ format='PEM',
+ passphrase=cls.private_key_passphrase,
+ use_pkcs8=True,
+ protection='PBKDF2WithHMAC-SHA1AndAES128-CBC'
+ )
+ with open(cls.ec_p521_key_path, "wt") as f:
+ f.write(private_key)
+
+ def test_valid_http_signature(self):
+ privkey_path = self.rsa_key_path
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=privkey_path,
+ private_key_passphrase=self.private_key_passphrase,
+ signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15,
+ signed_headers=[
+ signing.HEADER_REQUEST_TARGET,
+ signing.HEADER_CREATED,
+ signing.HEADER_HOST,
+ signing.HEADER_DATE,
+ signing.HEADER_DIGEST,
+ 'Content-Type'
+ ]
+ )
+ config = Configuration(host=HOST, signing_info=signing_cfg)
+ # Set the OAuth2 access_token to None. Here we are interested in testing
+ # the HTTP signature scheme.
+ config.access_token = None
+
+ api_client = petstore_api.ApiClient(config)
+ pet_api = PetApi(api_client)
+
+ mock_pool = MockPoolManager(self)
+ api_client.rest_client.pool_manager = mock_pool
+
+ mock_pool.set_signing_config(signing_cfg)
+ mock_pool.expect_request('POST', HOST + '/pet',
+ #body=json.dumps(api_client.sanitize_for_serialization(self.pet)),
+ body=self.pet.to_json(),
+ headers={'Content-Type': r'application/json',
+ 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,'
+ r'headers="\(request-target\) \(created\) host date digest content-type",'
+ r'signature="[a-zA-Z0-9+/=]+"',
+ 'User-Agent': r'OpenAPI-Generator/1.0.0/python'},
+ preload_content=True, timeout=None)
+
+ pet_api.add_pet(self.pet)
+
+ def test_valid_http_signature_with_defaults(self):
+ privkey_path = self.rsa4096_key_path
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=privkey_path,
+ private_key_passphrase=self.private_key_passphrase,
+ )
+ config = Configuration(host=HOST, signing_info=signing_cfg)
+ # Set the OAuth2 access_token to None. Here we are interested in testing
+ # the HTTP signature scheme.
+ config.access_token = None
+
+ api_client = petstore_api.ApiClient(config)
+ pet_api = PetApi(api_client)
+
+ mock_pool = MockPoolManager(self)
+ api_client.rest_client.pool_manager = mock_pool
+
+ mock_pool.set_signing_config(signing_cfg)
+ mock_pool.expect_request('POST', HOST + '/pet',
+ #body=json.dumps(api_client.sanitize_for_serialization(self.pet)),
+ body=self.pet.to_json(),
+ headers={'Content-Type': r'application/json',
+ 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,'
+ r'headers="\(created\)",'
+ r'signature="[a-zA-Z0-9+/=]+"',
+ 'User-Agent': r'OpenAPI-Generator/1.0.0/python'},
+ preload_content=True, timeout=None)
+
+ pet_api.add_pet(self.pet)
+
+ def test_valid_http_signature_rsassa_pkcs1v15(self):
+ privkey_path = self.rsa4096_key_path
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=privkey_path,
+ private_key_passphrase=self.private_key_passphrase,
+ signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15,
+ signed_headers=[
+ signing.HEADER_REQUEST_TARGET,
+ signing.HEADER_CREATED,
+ ]
+ )
+ config = Configuration(host=HOST, signing_info=signing_cfg)
+ # Set the OAuth2 access_token to None. Here we are interested in testing
+ # the HTTP signature scheme.
+ config.access_token = None
+
+ api_client = petstore_api.ApiClient(config)
+ pet_api = PetApi(api_client)
+
+ mock_pool = MockPoolManager(self)
+ api_client.rest_client.pool_manager = mock_pool
+
+ mock_pool.set_signing_config(signing_cfg)
+ mock_pool.expect_request('POST', HOST + '/pet',
+ #body=json.dumps(api_client.sanitize_for_serialization(self.pet)),
+ body=self.pet.to_json(),
+ headers={'Content-Type': r'application/json',
+ 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,'
+ r'headers="\(request-target\) \(created\)",'
+ r'signature="[a-zA-Z0-9+/=]+"',
+ 'User-Agent': r'OpenAPI-Generator/1.0.0/python'},
+ preload_content=True, timeout=None)
+
+ pet_api.add_pet(self.pet)
+
+ def test_valid_http_signature_rsassa_pss(self):
+ privkey_path = self.rsa4096_key_path
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=privkey_path,
+ private_key_passphrase=self.private_key_passphrase,
+ signing_algorithm=signing.ALGORITHM_RSASSA_PSS,
+ signed_headers=[
+ signing.HEADER_REQUEST_TARGET,
+ signing.HEADER_CREATED,
+ ]
+ )
+ config = Configuration(host=HOST, signing_info=signing_cfg)
+ # Set the OAuth2 access_token to None. Here we are interested in testing
+ # the HTTP signature scheme.
+ config.access_token = None
+
+ api_client = petstore_api.ApiClient(config)
+ pet_api = PetApi(api_client)
+
+ mock_pool = MockPoolManager(self)
+ api_client.rest_client.pool_manager = mock_pool
+
+ mock_pool.set_signing_config(signing_cfg)
+ mock_pool.expect_request('POST', HOST + '/pet',
+ #body=json.dumps(api_client.sanitize_for_serialization(self.pet)),
+ body=self.pet.to_json(),
+ headers={'Content-Type': r'application/json',
+ 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,'
+ r'headers="\(request-target\) \(created\)",'
+ r'signature="[a-zA-Z0-9+/=]+"',
+ 'User-Agent': r'OpenAPI-Generator/1.0.0/python'},
+ preload_content=True, timeout=None)
+
+ pet_api.add_pet(self.pet)
+
+ def test_valid_http_signature_ec_p521(self):
+ privkey_path = self.ec_p521_key_path
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=privkey_path,
+ private_key_passphrase=self.private_key_passphrase,
+ hash_algorithm=signing.HASH_SHA512,
+ signed_headers=[
+ signing.HEADER_REQUEST_TARGET,
+ signing.HEADER_CREATED,
+ ]
+ )
+ config = Configuration(host=HOST, signing_info=signing_cfg)
+ # Set the OAuth2 access_token to None. Here we are interested in testing
+ # the HTTP signature scheme.
+ config.access_token = None
+
+ api_client = petstore_api.ApiClient(config)
+ pet_api = PetApi(api_client)
+
+ mock_pool = MockPoolManager(self)
+ api_client.rest_client.pool_manager = mock_pool
+
+ mock_pool.set_signing_config(signing_cfg)
+ mock_pool.expect_request('POST', HOST + '/pet',
+ #body=json.dumps(api_client.sanitize_for_serialization(self.pet)),
+ body=self.pet.to_json(),
+ headers={'Content-Type': r'application/json',
+ 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,'
+ r'headers="\(request-target\) \(created\)",'
+ r'signature="[a-zA-Z0-9+/=]+"',
+ 'User-Agent': r'OpenAPI-Generator/1.0.0/python'},
+ preload_content=True, timeout=None)
+
+ pet_api.add_pet(self.pet)
+
+ def test_invalid_configuration(self):
+ # Signing scheme must be valid.
+ with self.assertRaises(Exception) as cm:
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme='foo',
+ private_key_path=self.ec_p521_key_path
+ )
+ self.assertTrue(re.match('Unsupported security scheme', str(cm.exception)),
+ 'Exception message: {0}'.format(str(cm.exception)))
+
+ # Signing scheme must be specified.
+ with self.assertRaises(Exception) as cm:
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ private_key_path=self.ec_p521_key_path,
+ signing_scheme=None
+ )
+ self.assertTrue(re.match('Unsupported security scheme', str(cm.exception)),
+ 'Exception message: {0}'.format(str(cm.exception)))
+
+ # Private key passphrase is missing but key is encrypted.
+ with self.assertRaises(Exception) as cm:
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=self.ec_p521_key_path,
+ )
+ self.assertTrue(re.match('Not a valid clear PKCS#8 structure', str(cm.exception)),
+ 'Exception message: {0}'.format(str(cm.exception)))
+
+ # File containing private key must exist.
+ with self.assertRaises(Exception) as cm:
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path='foobar',
+ )
+ self.assertTrue(re.match('Private key file does not exist', str(cm.exception)),
+ 'Exception message: {0}'.format(str(cm.exception)))
+
+ # The max validity must be a positive value.
+ with self.assertRaises(Exception) as cm:
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=self.ec_p521_key_path,
+ signature_max_validity=timedelta(hours=-1)
+ )
+ self.assertTrue(re.match('The signature max validity must be a positive value',
+ str(cm.exception)),
+ 'Exception message: {0}'.format(str(cm.exception)))
+
+ # Cannot include the 'Authorization' header.
+ with self.assertRaises(Exception) as cm:
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=self.ec_p521_key_path,
+ signed_headers=['Authorization']
+ )
+ self.assertTrue(re.match("'Authorization' header cannot be included", str(cm.exception)),
+ 'Exception message: {0}'.format(str(cm.exception)))
+
+ # Cannot specify duplicate headers.
+ with self.assertRaises(Exception) as cm:
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=self.ec_p521_key_path,
+ signed_headers=['Host', 'Date', 'Host']
+ )
+ self.assertTrue(re.match('Cannot have duplicates in the signed_headers parameter',
+ str(cm.exception)),
+ 'Exception message: {0}'.format(str(cm.exception)))
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_map_test.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_map_test.py
new file mode 100644
index 00000000000..4b2c6d5069e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_map_test.py
@@ -0,0 +1,117 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ pip install nose (optional)
+$ cd petstore_api-python
+$ nosetests -v
+"""
+
+import os
+import time
+import unittest
+
+import petstore_api
+
+
+class MapTestTests(unittest.TestCase):
+
+ def test_maptest_init(self):
+ #
+ # Test MapTest construction with valid values
+ #
+ up_or_low_dict = {
+ 'UPPER': "UP",
+ 'lower': "low"
+ }
+# map_enum_test = petstore_api.MapTest(map_of_enum_string=up_or_low_dict)
+#
+# self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict)
+#
+# map_of_map_of_strings = {
+# 'val1': 1,
+# 'valText': "Text",
+# 'valueDict': up_or_low_dict
+# }
+# map_enum_test = petstore_api.MapTest(map_map_of_string=map_of_map_of_strings)
+#
+# self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings)
+#
+# #
+# # Make sure that the init fails for invalid enum values
+# #
+# black_or_white_dict = {
+# 'black': "UP",
+# 'white': "low"
+# }
+# try:
+# map_enum_test = petstore_api.MapTest(map_of_enum_string=black_or_white_dict)
+# self.assertTrue(0)
+# except ValueError:
+# self.assertTrue(1)
+#
+# def test_maptest_setter(self):
+# #
+# # Check with some valid values
+# #
+# map_enum_test = petstore_api.MapTest()
+# up_or_low_dict = {
+# 'UPPER': "UP",
+# 'lower': "low"
+# }
+# map_enum_test.map_of_enum_string = up_or_low_dict
+# self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict)
+#
+# #
+# # Check if the setter fails for invalid enum values
+# #
+# map_enum_test = petstore_api.MapTest()
+# black_or_white_dict = {
+# 'black': "UP",
+# 'white': "low"
+# }
+# try:
+# map_enum_test.map_of_enum_string = black_or_white_dict
+# except ValueError:
+# self.assertEqual(map_enum_test.map_of_enum_string, None)
+#
+# def test_todict(self):
+# #
+# # Check dictionary serialization
+# #
+# map_enum_test = petstore_api.MapTest()
+# up_or_low_dict = {
+# 'UPPER': "UP",
+# 'lower': "low"
+# }
+# map_of_map_of_strings = {
+# 'val1': 1,
+# 'valText': "Text",
+# 'valueDict': up_or_low_dict
+# }
+# indirect_map = {
+# 'option1': True
+# }
+# direct_map = {
+# 'option2': False
+# }
+# map_enum_test.map_of_enum_string = up_or_low_dict
+# map_enum_test.map_map_of_string = map_of_map_of_strings
+# map_enum_test.indirect_map = indirect_map
+# map_enum_test.direct_map = direct_map
+#
+# self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict)
+# self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings)
+# self.assertEqual(map_enum_test.indirect_map, indirect_map)
+# self.assertEqual(map_enum_test.direct_map, direct_map)
+#
+# expected_dict = {
+# 'map_of_enum_string': up_or_low_dict,
+# 'map_map_of_string': map_of_map_of_strings,
+# 'indirect_map': indirect_map,
+# 'direct_map': direct_map
+# }
+#
+# self.assertEqual(map_enum_test.to_dict(), expected_dict)
diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_model.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_model.py
new file mode 100644
index 00000000000..7afbb9c4ecf
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_model.py
@@ -0,0 +1,297 @@
+# coding: utf-8
+
+# flake8: noqa
+
+
+import os
+import time
+import unittest
+
+import petstore_api
+
+
+class ModelTests(unittest.TestCase):
+
+ def setUp(self):
+ self.pet = petstore_api.Pet(name="test name", photo_urls=["string"])
+ self.pet.id = 1
+ self.pet.status = "available"
+ cate = petstore_api.Category(name="dog")
+ cate.id = 1
+ cate.name = "dog"
+ self.pet.category = cate
+ tag = petstore_api.Tag()
+ tag.id = 1
+ self.pet.tags = [tag]
+
+ def test_cat(self):
+ self.cat = petstore_api.Cat(class_name="cat")
+ self.assertEqual("cat", self.cat.class_name)
+ self.assertEqual("red", self.cat.color)
+ cat_str = ("{'additional_properties': {},\n"
+ " 'className': 'cat',\n"
+ " 'color': 'red',\n"
+ " 'declawed': None}")
+ self.assertEqual(cat_str, self.cat.to_str())
+
+ def test_to_str(self):
+ data = ("{'additional_properties': {},\n"
+ " 'category': {'additional_properties': {}, 'id': 1, 'name': 'dog'},\n"
+ " 'id': 1,\n"
+ " 'name': 'test name',\n"
+ " 'photoUrls': ['string'],\n"
+ " 'status': 'available',\n"
+ " 'tags': [{'additional_properties': {}, 'id': 1, 'name': None}]}")
+ self.assertEqual(data, self.pet.to_str())
+
+ def test_equal(self):
+ self.pet1 = petstore_api.Pet(name="test name", photo_urls=["string"])
+ self.pet1.id = 1
+ self.pet1.status = "available"
+ cate1 = petstore_api.Category(name="dog")
+ cate1.id = 1
+ # cate1.name = "dog"
+ self.pet.category = cate1
+ tag1 = petstore_api.Tag()
+ tag1.id = 1
+ self.pet1.tags = [tag1]
+
+ self.pet2 = petstore_api.Pet(name="test name", photo_urls=["string"])
+ self.pet2.id = 1
+ self.pet2.status = "available"
+ cate2 = petstore_api.Category(name="dog")
+ cate2.id = 1
+ cate2.name = "dog"
+ self.pet.category = cate2
+ tag2 = petstore_api.Tag()
+ tag2.id = 1
+ self.pet2.tags = [tag2]
+
+ self.assertTrue(self.pet1 == self.pet2)
+
+ # reset pet1 tags to empty array so that object comparison returns false
+ self.pet1.tags = []
+ self.assertFalse(self.pet1 == self.pet2)
+
+ def test_oneOf(self):
+ # test new Pig
+ new_pig = petstore_api.Pig()
+ self.assertEqual("null", new_pig.to_json())
+ self.assertEqual(None, new_pig.actual_instance)
+
+ # test from_json
+ json_str = '{"className": "BasquePig", "color": "red"}'
+ p = petstore_api.Pig.from_json(json_str)
+ self.assertIsInstance(p.actual_instance, petstore_api.BasquePig)
+
+ # test init
+ basque_pig = p.actual_instance
+ pig2 = petstore_api.Pig(actual_instance=basque_pig)
+ self.assertIsInstance(pig2.actual_instance, petstore_api.BasquePig)
+
+ # test failed init
+ try:
+ pig3 = petstore_api.Pig(actual_instance="123")
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ self.assertTrue(
+ "No match found when deserializing the JSON string into Pig with oneOf schemas: "
+ "BasquePig, DanishPig" in str(e))
+
+ # failure
+ try:
+ p2 = petstore_api.Pig.from_json("1")
+ self.assertTrue(False) # this line shouldn't execute
+ except AttributeError as e:
+ self.assertEqual(str(e), "'int' object has no attribute 'get'")
+ # comment out below as the error message is different using oneOf discriminator looku option
+ #except ValueError as e:
+ # error_message = (
+ # "No match found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. "
+ # "Details: 1 validation error for BasquePig\n"
+ # "__root__\n"
+ # " BasquePig expected dict not int (type=type_error), 1 validation error for DanishPig\n"
+ # "__root__\n"
+ # " DanishPig expected dict not int (type=type_error)")
+ # self.assertEqual(str(e), error_message)
+
+ # test to_json
+ self.assertEqual(p.to_json(), '{"className": "BasquePig", "color": "red"}')
+
+ # test nested property
+ nested = petstore_api.WithNestedOneOf(size = 1, nested_pig = p)
+ self.assertEqual(nested.to_json(), '{"size": 1, "nested_pig": {"className": "BasquePig", "color": "red"}}')
+
+ nested_json = nested.to_json()
+ nested2 = petstore_api.WithNestedOneOf.from_json(nested_json)
+ self.assertEqual(nested2.to_json(), nested_json)
+
+ def test_anyOf(self):
+ # test new AnyOfPig
+ new_anypig = petstore_api.AnyOfPig()
+ self.assertEqual("null", new_anypig.to_json())
+ self.assertEqual(None, new_anypig.actual_instance)
+
+ # test from_json
+ json_str = '{"className": "BasquePig", "color": "red"}'
+ p = petstore_api.AnyOfPig.from_json(json_str)
+ self.assertIsInstance(p.actual_instance, petstore_api.BasquePig)
+
+ # test init
+ basque_pig = p.actual_instance
+ pig2 = petstore_api.Pig(actual_instance=basque_pig)
+ self.assertIsInstance(pig2.actual_instance, petstore_api.BasquePig)
+
+ # test failed init
+ try:
+ pig3 = petstore_api.AnyOfPig(actual_instance="123")
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ self.assertTrue(
+ "No match found when deserializing the JSON string into AnyOfPig with anyOf schemas: BasquePig, "
+ "DanishPig" in str(e))
+
+ # failure
+ try:
+ p2 = petstore_api.AnyOfPig.from_json("1")
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ error_message = (
+ "No match found when deserializing the JSON string into AnyOfPig with anyOf schemas: BasquePig, "
+ "DanishPig. Details: 1 validation error for BasquePig\n"
+ "__root__\n"
+ " BasquePig expected dict not int (type=type_error), 1 validation error for DanishPig\n"
+ "__root__\n"
+ " DanishPig expected dict not int (type=type_error)")
+ self.assertEqual(str(e), error_message)
+
+ # test to_json
+ self.assertEqual(p.to_json(), '{"className": "BasquePig", "color": "red"}')
+
+ def test_inheritance(self):
+ dog = petstore_api.Dog(breed="bulldog", className="dog", color="white")
+ self.assertEqual(dog.to_json(), '{"className": "dog", "color": "white", "breed": "bulldog"}')
+ self.assertEqual(dog.to_dict(), {'breed': 'bulldog', 'className':
+ 'dog', 'color': 'white'})
+ dog2 = petstore_api.Dog.from_json(dog.to_json())
+ self.assertEqual(dog2.breed, 'bulldog')
+ self.assertEqual(dog2.class_name, "dog")
+ self.assertEqual(dog2.color, 'white')
+
+ def test_list(self):
+ # should throw exception as var_123_list should be string
+ try:
+ l3 = petstore_api.List(var_123_list=123)
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ #error_message = (
+ # "1 validation error for List\n"
+ # "123-list\n"
+ # " str type expected (type=type_error.str)\n")
+ self.assertTrue("str type expected" in str(e))
+
+ l = petstore_api.List(var_123_list="bulldog")
+ self.assertEqual(l.to_json(), '{"123-list": "bulldog"}')
+ self.assertEqual(l.to_dict(), {'123-list': 'bulldog'})
+ l2 = petstore_api.List.from_json(l.to_json())
+ self.assertEqual(l2.var_123_list, 'bulldog')
+
+ self.assertTrue(isinstance(l2, petstore_api.List))
+
+ def test_enum_ref_property(self):
+ # test enum ref property
+ # test to_json
+ d = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1)
+ self.assertEqual(d.to_json(), '{"value": 1, "str_value": null}')
+ d2 = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1, str_value=petstore_api.OuterEnum.DELIVERED)
+ self.assertEqual(d2.to_json(), '{"str_value": "delivered", "value": 1}')
+ # test from_json (round trip)
+ d3 = petstore_api.OuterObjectWithEnumProperty.from_json(d2.to_json())
+ self.assertEqual(d3.str_value, petstore_api.OuterEnum.DELIVERED)
+ self.assertEqual(d3.value, petstore_api.OuterEnumInteger.NUMBER_1)
+ self.assertEqual(d3.to_json(), '{"str_value": "delivered", "value": 1}')
+
+ def test_valdiator(self):
+ # test regular expression
+ a = petstore_api.FormatTest(number=123.45, byte=bytes("string", 'utf-8'), date="2013-09-17", password="testing09876")
+ try:
+ a.pattern_with_digits_and_delimiter = "123"
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ self.assertTrue(r"must validate the regular expression /^image_\d{1,3}$/i" in str(e))
+
+ a.pattern_with_digits_and_delimiter = "IMAGE_123"
+ self.assertEqual(a.pattern_with_digits_and_delimiter, "IMAGE_123")
+ a.pattern_with_digits_and_delimiter = "image_123"
+ self.assertEqual(a.pattern_with_digits_and_delimiter, "image_123")
+
+ def test_inline_enum_validator(self):
+ self.pet = petstore_api.Pet(name="test name", photo_urls=["string"])
+ self.pet.id = 1
+ try:
+ self.pet.status = "error"
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ self.assertTrue("must validate the enum values ('available', 'pending', 'sold')" in str(e))
+
+ def test_object_id(self):
+ pet_ap = petstore_api.Pet(name="test name", photo_urls=["string"])
+ pet_ap2 = petstore_api.Pet(name="test name", photo_urls=["string"])
+ self.assertNotEqual(id(pet_ap), id(pet_ap2))
+
+ pet_ap3 = petstore_api.Pet.from_dict(pet_ap.to_dict())
+ pet_ap4 = petstore_api.Pet.from_dict(pet_ap.to_dict())
+ self.assertNotEqual(id(pet_ap3), id(pet_ap4))
+
+
+ def test_additional_properties(self):
+ pet_ap = petstore_api.Pet(name="test name", photo_urls=["string"])
+ pet_ap.id = 1
+ pet_ap.status = "available"
+
+ pet_ap2 = petstore_api.Pet(name="test name", photo_urls=["string"])
+ pet_ap2.id = 1
+ pet_ap2.status = "available"
+
+ self.assertNotEqual(id(pet_ap.additional_properties), id(pet_ap2.additional_properties))
+
+ pet_ap.additional_properties["something-new"] = "haha"
+ self.assertEqual(pet_ap.to_json(), '{"id": 1, "name": "test name", "photoUrls": ["string"], "status": "available", "something-new": "haha"}')
+ self.assertEqual(type(pet_ap2.additional_properties), dict)
+ self.assertNotEqual(id(pet_ap.additional_properties), id(pet_ap2.additional_properties))
+ self.assertEqual(pet_ap.additional_properties["something-new"], "haha")
+
+ try:
+ _tmp = pet_ap2.additional_properties["something-new"]
+ self.assertTrue(False) # this line shouldn't execute
+ except KeyError as e:
+ self.assertEqual("'something-new'", str(e))
+
+ pet_ap_dict = pet_ap.to_dict()
+ pet_ap_dict["something-new"] = 123
+ pet_ap_dict["array"] = ["a", "b"]
+ pet_ap_dict["dict"] = {"key999": "value999"}
+
+ pet_ap2 = petstore_api.Pet.from_dict(pet_ap_dict)
+
+ self.assertEqual(pet_ap2.additional_properties["array"], ["a", "b"])
+ self.assertEqual(pet_ap2.additional_properties["something-new"], 123)
+ self.assertEqual(pet_ap2.additional_properties["dict"], {"key999": "value999"})
+
+ def test_nullable(self):
+ h = petstore_api.HealthCheckResult(nullable_message="Not none")
+ self.assertEqual(h.to_json(), '{"NullableMessage": "Not none"}')
+
+ h.nullable_message = None
+ self.assertEqual(h.to_json(), '{"NullableMessage": null}')
+
+ #import json
+ #dictionary ={
+ # "id": "04",
+ # "name": "sunil",
+ # "department": None
+ #}
+ #
+ ## Serializing json
+ #json_object = json.dumps(dictionary)
+ #self.assertEqual(json_object, "")
diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_order_model.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_order_model.py
new file mode 100644
index 00000000000..7d4afba5b1d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_order_model.py
@@ -0,0 +1,20 @@
+# coding: utf-8
+
+# flake8: noqa
+
+import os
+import time
+import unittest
+
+import petstore_api
+
+
+class OrderModelTests(unittest.TestCase):
+
+ def test_status(self):
+ order = petstore_api.Order()
+ # order.status = "placed"
+ # self.assertEqual("placed", order.status)
+
+ # with self.assertRaises(ValueError):
+ # order.status = "invalid"
diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_pet_api.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_pet_api.py
new file mode 100644
index 00000000000..60302f0a776
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_pet_api.py
@@ -0,0 +1,272 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ docker pull swaggerapi/petstore
+$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
+$ pip install nose (optional)
+$ cd petstore_api-python
+$ nosetests -v
+"""
+
+import os
+import unittest
+
+import petstore_api
+from petstore_api import Configuration
+from petstore_api.rest import ApiException
+
+from .util import id_gen
+
+import json
+
+import urllib3
+
+HOST = 'http://petstore.swagger.io/v2'
+
+
+class TimeoutWithEqual(urllib3.Timeout):
+ def __init__(self, *arg, **kwargs):
+ super(TimeoutWithEqual, self).__init__(*arg, **kwargs)
+
+ def __eq__(self, other):
+ return self._read == other._read and self._connect == other._connect and self.total == other.total
+
+
+class MockPoolManager(object):
+ def __init__(self, tc):
+ self._tc = tc
+ self._reqs = []
+
+ def expect_request(self, *args, **kwargs):
+ self._reqs.append((args, kwargs))
+
+ def request(self, *args, **kwargs):
+ self._tc.assertTrue(len(self._reqs) > 0)
+ r = self._reqs.pop(0)
+ self._tc.maxDiff = None
+ self._tc.assertEqual(r[0], args)
+ self._tc.assertEqual(r[1], kwargs)
+ return urllib3.HTTPResponse(status=200, body=b'test')
+
+
+class PetApiTests(unittest.TestCase):
+
+ def setUp(self):
+ config = Configuration()
+ config.host = HOST
+ config.access_token = 'ACCESS_TOKEN'
+ self.api_client = petstore_api.ApiClient(config)
+ self.pet_api = petstore_api.PetApi(self.api_client)
+ self.setUpModels()
+ self.setUpFiles()
+
+ def setUpModels(self):
+ self.category = petstore_api.Category(name="dog")
+ self.category.id = id_gen()
+ # self.category.name = "dog"
+ self.tag = petstore_api.Tag()
+ self.tag.id = id_gen()
+ self.tag.name = "python-pet-tag"
+ self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
+ self.pet.id = id_gen()
+ self.pet.status = "sold"
+ self.pet.category = self.category
+ self.pet.tags = [self.tag]
+
+ self.pet2 = petstore_api.Pet(name="superman 2", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
+ self.pet2.id = id_gen() + 1
+ self.pet2.status = "available"
+ self.pet2.category = self.category
+ self.pet2.tags = [self.tag]
+
+ def setUpFiles(self):
+ self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles")
+ self.test_file_dir = os.path.realpath(self.test_file_dir)
+ self.foo = os.path.join(self.test_file_dir, "pix.gif")
+
+ def test_preload_content_flag(self):
+ self.pet_api.add_pet(self.pet)
+
+ resp = self.pet_api.find_pets_by_status(status=[self.pet.status], _preload_content=False)
+
+ # return response should at least have read and close methods.
+ self.assertTrue(hasattr(resp, 'read'))
+ self.assertTrue(hasattr(resp, 'close'))
+
+ # Also we need to make sure we can release the connection to a pool (if exists) when we are done with it.
+ self.assertTrue(hasattr(resp, 'release_conn'))
+
+ # Right now, the client returns urllib3.HTTPResponse. If that changed in future, it is probably a breaking
+ # change, however supporting above methods should be enough for most usecases. Remove this test case if
+ # we followed the breaking change procedure for python client (e.g. increasing major version).
+ self.assertTrue(resp.__class__, 'urllib3.response.HTTPResponse')
+
+ resp.close()
+ resp.release_conn()
+
+ def test_timeout(self):
+ mock_pool = MockPoolManager(self)
+ self.api_client.rest_client.pool_manager = mock_pool
+
+ mock_pool.expect_request('POST', HOST + '/pet',
+ body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)),
+ headers={'Content-Type': 'application/json',
+ 'Authorization': 'Bearer ACCESS_TOKEN',
+ 'User-Agent': 'OpenAPI-Generator/1.0.0/python'},
+ preload_content=True, timeout=TimeoutWithEqual(total=5))
+ mock_pool.expect_request('POST', HOST + '/pet',
+ body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)),
+ headers={'Content-Type': 'application/json',
+ 'Authorization': 'Bearer ACCESS_TOKEN',
+ 'User-Agent': 'OpenAPI-Generator/1.0.0/python'},
+ preload_content=True, timeout=TimeoutWithEqual(connect=1, read=2))
+
+ self.pet_api.add_pet(self.pet, _request_timeout=5)
+ self.pet_api.add_pet(self.pet, _request_timeout=(1, 2))
+
+ def test_separate_default_config_instances(self):
+ # ensure the default api client is used
+ pet_api = petstore_api.PetApi()
+ pet_api2 = petstore_api.PetApi()
+ self.assertEqual(id(pet_api.api_client), id(pet_api2.api_client))
+ # ensure the default configuration is used
+ self.assertEqual(id(pet_api.api_client.configuration), id(pet_api2.api_client.configuration))
+
+ def test_async_request(self):
+ thread = self.pet_api.add_pet(self.pet, async_req=True)
+ response = thread.get()
+ self.assertIsNone(response)
+
+ thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True)
+ result = thread.get()
+ self.assertIsInstance(result, petstore_api.Pet)
+
+ def test_async_with_result(self):
+ self.pet_api.add_pet(self.pet, async_req=False)
+
+ thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True)
+ thread2 = self.pet_api.get_pet_by_id(self.pet.id, async_req=True)
+
+ response = thread.get()
+ response2 = thread2.get()
+
+ self.assertEqual(response.id, self.pet.id)
+ self.assertIsNotNone(response2.id, self.pet.id)
+
+ def test_async_with_http_info(self):
+ self.pet_api.add_pet(self.pet)
+
+ thread = self.pet_api.get_pet_by_id_with_http_info(self.pet.id, async_req=True)
+ data, status, headers = thread.get()
+
+ self.assertIsInstance(data, petstore_api.Pet)
+ self.assertEqual(status, 200)
+
+ def test_async_exception(self):
+ self.pet_api.add_pet(self.pet)
+
+ thread = self.pet_api.get_pet_by_id(9999999999999, async_req=True)
+
+ exception = None
+ try:
+ thread.get()
+ except ApiException as e:
+ exception = e
+
+ self.assertIsInstance(exception, ApiException)
+ self.assertEqual(exception.status, 404)
+
+ def test_add_pet_and_get_pet_by_id(self):
+ self.pet_api.add_pet(self.pet)
+
+ fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id)
+ self.assertIsNotNone(fetched)
+ self.assertEqual(self.pet.id, fetched.id)
+ self.assertIsNotNone(fetched.category)
+ self.assertEqual(self.pet.category.name, fetched.category.name)
+
+ def test_add_pet_and_get_pet_by_id_with_http_info(self):
+ self.pet_api.add_pet(self.pet)
+
+ fetched = self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id)
+ self.assertIsNotNone(fetched)
+ self.assertEqual(self.pet.id, fetched[0].id)
+ self.assertIsNotNone(fetched[0].category)
+ self.assertEqual(self.pet.category.name, fetched[0].category.name)
+
+ def test_update_pet(self):
+ self.pet.name = "hello kity with updated"
+ self.pet_api.update_pet(self.pet)
+
+ fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id)
+ self.assertIsNotNone(fetched)
+ self.assertEqual(self.pet.id, fetched.id)
+ self.assertEqual(self.pet.name, fetched.name)
+ self.assertIsNotNone(fetched.category)
+ self.assertEqual(fetched.category.name, self.pet.category.name)
+
+ def test_find_pets_by_status(self):
+ self.pet_api.add_pet(self.pet)
+ self.pet_api.add_pet(self.pet2)
+
+ results = self.pet_api.find_pets_by_status(status=["pending", "available"])
+ self.assertIsInstance(results, list)
+ self.assertTrue(len(results) > 1)
+ # TODO
+ #for result in results:
+ # self.assertTrue(result.status in ["sold", "available"])
+
+ def test_find_pets_by_tags(self):
+ self.pet_api.add_pet(self.pet)
+
+ self.assertIn(
+ self.pet.id,
+ list(map(lambda x: getattr(x, 'id'), self.pet_api.find_pets_by_tags(tags=[self.tag.name, "here is another tag"])))
+ )
+
+ def test_update_pet_with_form(self):
+ self.pet_api.add_pet(self.pet)
+
+ name = "hello kity with form updated abc"
+ status = "pending"
+ self.pet_api.update_pet_with_form(pet_id=self.pet.id, name=name, status=status)
+
+ fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id)
+ self.assertEqual(self.pet.id, fetched.id)
+ self.assertEqual(name, fetched.name)
+ self.assertEqual(status, fetched.status)
+
+ def test_upload_file(self):
+ # upload file with form parameter
+ try:
+ additional_metadata = "special data 123"
+ self.pet_api.upload_file(
+ pet_id=self.pet.id,
+ additional_metadata=additional_metadata,
+ file=self.foo
+ )
+ except ApiException as e:
+ self.fail("upload_file() raised {0} unexpectedly".format(type(e)))
+
+ # upload only file
+ try:
+ self.pet_api.upload_file(pet_id=self.pet.id, file=self.foo)
+ except ApiException as e:
+ self.fail("upload_file() raised {0} unexpectedly".format(type(e)))
+
+ def test_delete_pet(self):
+ self.pet_api.add_pet(self.pet)
+ self.pet_api.delete_pet(pet_id=self.pet.id, api_key="special-key")
+
+ try:
+ self.pet_api.get_pet_by_id(pet_id=self.pet.id)
+ raise Exception("expected an error")
+ except ApiException as e:
+ self.assertEqual(404, e.status)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_pet_model.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_pet_model.py
new file mode 100644
index 00000000000..2c8b2f40326
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_pet_model.py
@@ -0,0 +1,115 @@
+# coding: utf-8
+
+# flake8: noqa
+
+import os
+import time
+import unittest
+
+import petstore_api
+import json
+from pydantic import ValidationError
+
+
+class PetModelTests(unittest.TestCase):
+
+ def setUp(self):
+ self.pet = petstore_api.Pet(name="test name", photo_urls=["string"])
+ self.pet.id = 1
+ self.pet.status = "available"
+ cate = petstore_api.Category(name="dog")
+ cate.id = 1
+ # cate.name = "dog"
+ self.pet.category = cate
+ tag = petstore_api.Tag()
+ tag.id = 1
+ self.pet.tags = [tag]
+
+ def test_to_str(self):
+ data = ("{'additional_properties': {},\n"
+ " 'category': {'additional_properties': {}, 'id': 1, 'name': 'dog'},\n"
+ " 'id': 1,\n"
+ " 'name': 'test name',\n"
+ " 'photoUrls': ['string'],\n"
+ " 'status': 'available',\n"
+ " 'tags': [{'additional_properties': {}, 'id': 1, 'name': None}]}")
+ self.assertEqual(data, self.pet.to_str())
+
+ def test_equal(self):
+ self.pet1 = petstore_api.Pet(name="test name", photo_urls=["string"])
+ self.pet1.id = 1
+ self.pet1.status = "available"
+ cate1 = petstore_api.Category(name="dog")
+ cate1.id = 1
+ # cate1.name = "dog"
+ self.pet1.category = cate1
+ tag1 = petstore_api.Tag()
+ tag1.id = 1
+ self.pet1.tags = [tag1]
+
+ self.pet2 = petstore_api.Pet(name="test name", photo_urls=["string"])
+ self.pet2.id = 1
+ self.pet2.status = "available"
+ cate2 = petstore_api.Category(name="dog")
+ cate2.id = 1
+ # cate2.name = "dog"
+ self.pet2.category = cate2
+ tag2 = petstore_api.Tag()
+ tag2.id = 1
+ self.pet2.tags = [tag2]
+
+ self.assertTrue(self.pet1 == self.pet2)
+
+ # reset pet1 tags to empty array so that object comparison returns false
+ self.pet1.tags = []
+ self.assertFalse(self.pet1 == self.pet2)
+
+ # test from_json, to_json, to_dict, from_dict
+ def test_from_to_methods(self):
+ json_str = ("{\"category\": {\"id\": 1, \"name\": \"dog\"},\n"
+ " \"id\": 1,\n"
+ " \"name\": \"test name\",\n"
+ " \"photoUrls\": [\"string\"],\n"
+ " \"status\": \"available\",\n"
+ " \"tags\": [{\"id\": 1, \"name\": \"None\"}]}")
+ pet = petstore_api.Pet.from_json(json_str)
+ self.assertEqual(pet.id, 1)
+ self.assertEqual(pet.status, "available")
+ self.assertEqual(pet.photo_urls, ["string"])
+ self.assertEqual(pet.tags[0].id, 1)
+ self.assertEqual(pet.tags[0].name, "None")
+ self.assertEqual(pet.category.id, 1)
+ # test to_json
+ self.assertEqual(pet.to_json(),
+ '{"id": 1, "category": {"id": 1, "name": "dog"}, "name": "test name", "photoUrls": ['
+ '"string"], "tags": [{"id": 1, "name": "None"}], "status": "available"}')
+
+ # test to_dict
+ self.assertEqual(pet.to_dict(),
+ {"id": 1, "category": {"id": 1, "name": "dog"}, "name": "test name", "photoUrls": ["string"],
+ "tags": [{"id": 1, "name": "None"}], "status": "available"})
+
+ # test from_dict
+ pet2 = petstore_api.Pet.from_dict(pet.to_dict())
+ self.assertEqual(pet2.id, 1)
+ self.assertEqual(pet2.status, "available")
+ self.assertEqual(pet2.photo_urls, ["string"])
+ self.assertEqual(pet2.tags[0].id, 1)
+ self.assertEqual(pet2.tags[0].name, "None")
+ self.assertEqual(pet2.category.id, 1)
+
+ def test_unpack_operator(self):
+ d = {"name": "required name", "id": 123, "photoUrls": ["https://a.com", "https://b.com"]}
+ pet = petstore_api.Pet(**d)
+ self.assertEqual(pet.to_json(), '{"id": 123, "name": "required name", "photoUrls": ["https://a.com", "https://b.com"]}')
+ self.assertEqual(pet.to_dict(), {"id": 123, "name": "required name", "photoUrls": ["https://a.com", "https://b.com"]})
+
+ def test_optional_fields(self):
+ _pet = petstore_api.Pet(name="required name",
+ photoUrls=["https://a.com",
+ "https://b.com"])
+ self.assertEqual(_pet.to_json(), '{"name": "required name", "photoUrls": ["https://a.com", "https://b.com"]}')
+ self.assertEqual(_pet.to_dict(), {"name": "required name", "photoUrls": ["https://a.com", "https://b.com"]})
+
+
+
diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_store_api.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_store_api.py
new file mode 100644
index 00000000000..1817477aba6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_store_api.py
@@ -0,0 +1,32 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ pip install nose (optional)
+$ cd OpenAP/Petstore-python
+$ nosetests -v
+"""
+
+import os
+import time
+import unittest
+
+import petstore_api
+from petstore_api.rest import ApiException
+
+
+class StoreApiTests(unittest.TestCase):
+
+ def setUp(self):
+ self.store_api = petstore_api.StoreApi()
+
+ def tearDown(self):
+ # sleep 1 sec between two every 2 tests
+ time.sleep(1)
+
+ def test_get_inventory(self):
+ data = self.store_api.get_inventory()
+ self.assertIsNotNone(data)
+ self.assertTrue(isinstance(data, dict))
diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/util.py b/samples/openapi3/client/petstore/python-nextgen/tests/util.py
new file mode 100644
index 00000000000..113d7dcc547
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/tests/util.py
@@ -0,0 +1,8 @@
+# flake8: noqa
+
+import random
+
+
+def id_gen(bits=32):
+ """ Returns a n-bit randomly generated int """
+ return int(random.getrandbits(bits))
diff --git a/samples/openapi3/client/petstore/python-nextgen/tox.ini b/samples/openapi3/client/petstore/python-nextgen/tox.ini
new file mode 100755
index 00000000000..8989fc3c4d9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-nextgen/tox.ini
@@ -0,0 +1,9 @@
+[tox]
+envlist = py3
+
+[testenv]
+deps=-r{toxinidir}/requirements.txt
+ -r{toxinidir}/test-requirements.txt
+
+commands=
+ pytest --cov=petstore_api